From aafd04f712fc09789b12ee4b4e428503b3fc3060 Mon Sep 17 00:00:00 2001 From: Gilles Querret Date: Sun, 15 Jan 2023 10:28:18 +0100 Subject: [PATCH] PCTBgRun: log propath + DB connections in verbose mode (#500) --- src/java/com/phenix/pct/BackgroundWorker.java | 4 ++-- src/java/com/phenix/pct/PCTBgCompile.java | 4 +++- src/progress/pct/_server.p | 14 +++++++++++++- src/progress/pct/pctBgCompile.p | 1 - 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/java/com/phenix/pct/BackgroundWorker.java b/src/java/com/phenix/pct/BackgroundWorker.java index 624ab0b0f..dd89f4a40 100644 --- a/src/java/com/phenix/pct/BackgroundWorker.java +++ b/src/java/com/phenix/pct/BackgroundWorker.java @@ -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 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 { diff --git a/src/java/com/phenix/pct/PCTBgCompile.java b/src/java/com/phenix/pct/PCTBgCompile.java index f25ed4eb9..b1bb7f43a 100644 --- a/src/java/com/phenix/pct/PCTBgCompile.java +++ b/src/java/com/phenix/pct/PCTBgCompile.java @@ -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 @@ -372,6 +372,8 @@ public void handleResponse(String command, String parameter, boolean err, if (compAttrs.isStopOnError()) setStatusQuit(); } + } else { + logMessages(returnValues); } } } diff --git a/src/progress/pct/_server.p b/src/progress/pct/_server.p index ade27e49a..32f3b2603 100644 --- a/src/progress/pct/_server.p +++ b/src/progress/pct/_server.p @@ -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 */ @@ -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. @@ -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. @@ -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 @@ -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. diff --git a/src/progress/pct/pctBgCompile.p b/src/progress/pct/pctBgCompile.p index c0d10d664..9f6e6fdf5 100644 --- a/src/progress/pct/pctBgCompile.p +++ b/src/progress/pct/pctBgCompile.p @@ -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').