Skip to content

Commit e6f24f8

Browse files
committed
LDEV-1402 rename logSystemOutput to consoleOutput
1 parent e4ca7bc commit e6f24f8

File tree

5 files changed

+25
-25
lines changed

5 files changed

+25
-25
lines changed

luceedebug/src/main/java/luceedebug/DapServer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,8 +523,8 @@ private void configureLogging(Map<String, Object> args) {
523523
// logExceptions - default false
524524
Log.setLogExceptions(caster.toBooleanValue(args.get("logExceptions"), false));
525525

526-
// logSystemOutput - default false
527-
NativeDebuggerListener.setLogSystemOutput(caster.toBooleanValue(args.get("logSystemOutput"), false));
526+
// consoleOutput - default false (streams System.out/err to debug console)
527+
NativeDebuggerListener.setConsoleOutput(caster.toBooleanValue(args.get("consoleOutput"), false));
528528
}
529529

530530
static final Pattern threadNamePrefixAndDigitSuffix = Pattern.compile("^(.+?)(\\d+)$");

luceedebug/src/main/java/luceedebug/Log.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class Log {
2929
private static volatile boolean colorLogs = true;
3030
private static volatile LogLevel logLevel = LogLevel.INFO;
3131
private static volatile boolean logExceptions = false;
32-
private static volatile boolean logSystemOutput = false;
32+
private static volatile boolean consoleOutput = false;
3333

3434
// Internal debugging - only enabled via env var LUCEE_DEBUGGER_DEBUG
3535
private static final boolean internalDebug;
@@ -85,12 +85,12 @@ public static void setLogExceptions(boolean enabled) {
8585
}
8686

8787
/**
88-
* Set system output logging from launch.json.
88+
* Set console output streaming from launch.json.
8989
* When enabled, we skip sending directly to DAP since System.out/err
9090
* will be captured and forwarded via systemOutput().
9191
*/
92-
public static void setLogSystemOutput(boolean enabled) {
93-
logSystemOutput = enabled;
92+
public static void setConsoleOutput(boolean enabled) {
93+
consoleOutput = enabled;
9494
}
9595

9696
/**
@@ -101,9 +101,9 @@ public static void info(String message) {
101101
if (!LogLevel.INFO.isEnabled(logLevel)) {
102102
return;
103103
}
104-
// When logSystemOutput is enabled, skip System.out (it gets captured and
104+
// When consoleOutput is enabled, skip System.out (it gets captured and
105105
// forwarded to DAP, causing double-logging). Send directly to DAP instead.
106-
if (!logSystemOutput) {
106+
if (!consoleOutput) {
107107
String consoleMsg;
108108
if (colorLogs) {
109109
consoleMsg = ANSI_CYAN + PREFIX + ANSI_RESET + message;
@@ -119,7 +119,7 @@ public static void info(String message) {
119119
* Log an error message. Always logged regardless of log level.
120120
*/
121121
public static void error(String message) {
122-
if (!logSystemOutput) {
122+
if (!consoleOutput) {
123123
String consoleMsg;
124124
if (colorLogs) {
125125
consoleMsg = ANSI_RED + PREFIX + "ERROR: " + message + ANSI_RESET;
@@ -148,7 +148,7 @@ public static void debug(String message) {
148148
if (!internalDebug) {
149149
return;
150150
}
151-
if (!logSystemOutput) {
151+
if (!consoleOutput) {
152152
String consoleMsg;
153153
if (colorLogs) {
154154
consoleMsg = ANSI_DIM + PREFIX + "DEBUG: " + message + ANSI_RESET;
@@ -169,7 +169,7 @@ public static void trace(String message) {
169169
if (!internalDebug) {
170170
return;
171171
}
172-
if (!logSystemOutput) {
172+
if (!consoleOutput) {
173173
String consoleMsg;
174174
if (colorLogs) {
175175
consoleMsg = ANSI_DIM + PREFIX + "TRACE: " + message + ANSI_RESET;
@@ -190,7 +190,7 @@ public static void warn(String message) {
190190
if (!LogLevel.INFO.isEnabled(logLevel)) {
191191
return;
192192
}
193-
if (!logSystemOutput) {
193+
if (!consoleOutput) {
194194
String consoleMsg;
195195
if (colorLogs) {
196196
consoleMsg = ANSI_YELLOW + PREFIX + "WARN: " + message + ANSI_RESET;
@@ -229,7 +229,7 @@ public static void exception(Throwable t) {
229229

230230
/**
231231
* Forward System.out/err output to DAP client.
232-
* Called by NativeDebuggerListener.onOutput() when logSystemOutput is enabled.
232+
* Called by NativeDebuggerListener.onOutput() when consoleOutput is enabled.
233233
* Does NOT echo to console (would cause infinite loop).
234234
*
235235
* @param text The text that was written

luceedebug/src/main/java/luceedebug/coreinject/NativeDebuggerListener.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,9 @@ private static class CachedExecutableLines {
167167

168168
/**
169169
* Flag to forward System.out/err to DAP client.
170-
* Set via launch.json logSystemOutput option.
170+
* Set via launch.json consoleOutput option.
171171
*/
172-
private static volatile boolean logSystemOutput = false;
172+
private static volatile boolean consoleOutput = false;
173173

174174
/**
175175
* Fast-path flag: true when there's anything that could cause a suspend.
@@ -733,7 +733,7 @@ private static void onClientDisconnect() {
733733

734734
// Reset exception settings
735735
breakOnUncaughtExceptions = false;
736-
logSystemOutput = false;
736+
consoleOutput = false;
737737

738738
// Note: We intentionally keep breakpoints - they'll be inactive
739739
// since dapClientConnected=false, and will be replaced on next connect
@@ -762,20 +762,20 @@ public static boolean shouldBreakOnUncaughtExceptions() {
762762
* Set whether to forward System.out/err to DAP client.
763763
* Called from DapServer when handling attach request.
764764
*/
765-
public static void setLogSystemOutput(boolean enabled) {
766-
logSystemOutput = enabled;
767-
Log.setLogSystemOutput(enabled);
765+
public static void setConsoleOutput(boolean enabled) {
766+
consoleOutput = enabled;
767+
Log.setConsoleOutput(enabled);
768768
}
769769

770770
/**
771771
* Called by Lucee's DebuggerPrintStream when output is written to System.out/err.
772-
* Forwards to DAP client if logSystemOutput is enabled.
772+
* Forwards to DAP client if consoleOutput is enabled.
773773
*
774774
* @param text The text that was written
775775
* @param isStdErr true if stderr, false if stdout
776776
*/
777777
public static void onOutput(String text, boolean isStdErr) {
778-
if (!logSystemOutput || !dapClientConnected) {
778+
if (!consoleOutput || !dapClientConnected) {
779779
return;
780780
}
781781
Log.systemOutput(text, isStdErr);

luceedebug/src/main/java/luceedebug/coreinject/frame/NativeDebugFrame.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,9 +355,9 @@ private static synchronized boolean initReflection( ClassLoader luceeClassLoader
355355
}
356356

357357
try {
358-
// Check if DEBUGGER_ENABLED is true (via env var)
358+
// Check if debugger is enabled (via LUCEE_DEBUGGER_SECRET env var)
359359
if ( !EnvUtil.isDebuggerEnabled() ) {
360-
Log.info( "Native frame support disabled: LUCEE_DEBUGGER_ENABLED not set" );
360+
Log.info( "Native frame support disabled: LUCEE_DEBUGGER_SECRET not set" );
361361
nativeFrameSupportAvailable = false;
362362
return false;
363363
}

vscode-client/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,10 @@
194194
"default": false,
195195
"description": "Log exceptions to the debug console."
196196
},
197-
"logSystemOutput": {
197+
"consoleOutput": {
198198
"type": "boolean",
199199
"default": false,
200-
"description": "Show System.out/err in the debug console."
200+
"description": "Stream console output to the debug console (Lucee 7.1+)."
201201
},
202202
"secret": {
203203
"type": "string",

0 commit comments

Comments
 (0)