Skip to content

Commit

Permalink
PCTBgRun: log propath + DB connections in verbose mode (#500)
Browse files Browse the repository at this point in the history
  • Loading branch information
gquerret committed Jan 16, 2023
1 parent cec3c9f commit aafd04f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/java/com/phenix/pct/BackgroundWorker.java
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,11 @@ public abstract void handleResponse(String command, String parameter, boolean er

public final void handleStandardEventResponse(String command, String parameter, boolean err,
String customResponse, List<Message> returnValues) {
parent.logMessages(returnValues);
if ("connect".equalsIgnoreCase(command) && err) {
parent.logMessages(returnValues);
parent.setBuildException(new BuildException(command + "(" + parameter + ") : " + customResponse));
setStatusQuit();
}
}
}

public static final class Message {
Expand Down
4 changes: 3 additions & 1 deletion src/java/com/phenix/pct/PCTBgCompile.java
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ private String getOptions() {
sb.append(Boolean.toString(compAttrs.isXcode())).append(';');
sb.append("").append(';');
sb.append(Boolean.toString(compAttrs.isForceCompile())).append(';');
sb.append(Boolean.toString(false /* FIXME noCompile */)).append(';');
sb.append(Boolean.toString(false)).append(';'); // Previously noCompile
sb.append(Boolean.toString(compAttrs.isKeepXref())).append(';');
sb.append("").append(';'); // Previously languages
sb.append("").append(';'); // Previously growth factor
Expand Down Expand Up @@ -372,6 +372,8 @@ public void handleResponse(String command, String parameter, boolean err,
if (compAttrs.isStopOnError())
setStatusQuit();
}
} else {
logMessages(returnValues);
}
}
}
Expand Down
14 changes: 13 additions & 1 deletion src/progress/pct/_server.p
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,15 @@ PROCEDURE logDebug:
RUN log (ipMsg, 4).
END PROCEDURE.

PROCEDURE logInFirstThread:
DEFINE INPUT PARAMETER ipMsg AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER ipLvl AS INTEGER NO-UNDO.

IF (threadNumber EQ 1) THEN
RUN log(ipMsg, ipLvl).
END PROCEDURE.


/* Commands to be executed from executeCmd */
/* Each command should have an input param as char (command parameters) and */
/* an output param as logical, to tell ANT if command was executed successfully or not */
Expand All @@ -274,8 +283,8 @@ PROCEDURE propath:
DEFINE OUTPUT PARAMETER opOK AS LOGICAL NO-UNDO.
DEFINE OUTPUT PARAMETER opMsg AS CHARACTER NO-UNDO.

ASSIGN opOK = TRUE.
IF cPrm <> "" THEN PROPATH = cPrm + PROPATH.
ASSIGN opOK = TRUE.

END PROCEDURE.

Expand All @@ -292,6 +301,7 @@ PROCEDURE Connect :
DEFINE VARIABLE zz AS INTEGER NO-UNDO.

ASSIGN connectStr = ENTRY(1, cPrm, '|').
RUN logInFirstThread ("Trying to connect to : " + connectStr, 3).
CONNECT VALUE(connectStr) NO-ERROR.
IF ERROR-STATUS:ERROR THEN DO:
ASSIGN opok = FALSE.
Expand All @@ -309,6 +319,7 @@ PROCEDURE Connect :
LEAVE DbAliases.
END.

RUN logInFirstThread (SUBSTITUTE("Creating alias &1 for database &2", ENTRY(1, ENTRY(zz, cPrm, '|')), LDBNAME(dbNum)), 3).
IF ENTRY(2, ENTRY(zz, cPrm, '|')) EQ '1' THEN
CREATE ALIAS VALUE(ENTRY(1, ENTRY(zz, cPrm, '|'))) FOR DATABASE VALUE(LDBNAME(dbNum)) NO-ERROR.
ELSE
Expand Down Expand Up @@ -353,6 +364,7 @@ PROCEDURE launch:
DEFINE OUTPUT PARAMETER opOK AS LOGICAL NO-UNDO.
DEFINE OUTPUT PARAMETER opMsg AS CHARACTER NO-UNDO.

RUN logInFirstThread ("PROPATH : " + PROPATH, 3).
RUN VALUE(cPrm) PERSISTENT NO-ERROR.
IF ERROR-STATUS:ERROR THEN DO:
ASSIGN opOK = FALSE.
Expand Down
1 change: 0 additions & 1 deletion src/progress/pct/pctBgCompile.p
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ PROCEDURE setOptions:
RUN setOption IN hComp ('RUNLIST', IF ENTRY(1, ipPrm, ';') EQ 'true' THEN '1' ELSE '0').
RUN setOption IN hComp ('XCODE', IF ENTRY(4, ipPrm, ';') EQ 'true' THEN '1' ELSE '0').
RUN setOption IN hComp ('FORCECOMPILE', IF ENTRY(6, ipPrm, ';') EQ 'true' THEN '1' ELSE '0').
RUN setOption IN hComp ('NOCOMPILE', IF ENTRY(7, ipPrm, ';') EQ 'true' THEN '1' ELSE '0').
RUN setOption IN hComp ('KEEPXREF', IF ENTRY(8, ipPrm, ';') EQ 'true' THEN '1' ELSE '0').
RUN setOption IN hComp ('MULTICOMPILE', IF ENTRY(11, ipPrm, ';') EQ 'true' THEN '1' ELSE '0').
RUN setOption IN hComp ('RELATIVE', IF ENTRY(14, ipPrm, ';') EQ 'true' THEN '1' ELSE '0').
Expand Down

0 comments on commit aafd04f

Please sign in to comment.