diff --git a/impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/LookupInvoker.java b/impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/LookupInvoker.java index 40d3bb4926a4..a0b15ee2bae3 100644 --- a/impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/LookupInvoker.java +++ b/impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/LookupInvoker.java @@ -396,8 +396,13 @@ protected void doConfigureWithTerminalWithRawStreamsEnabled(C context) { protected void doConfigureWithTerminalWithRawStreamsDisabled(C context) { MavenSimpleLogger stdout = (MavenSimpleLogger) context.loggerFactory.getLogger("stdout"); MavenSimpleLogger stderr = (MavenSimpleLogger) context.loggerFactory.getLogger("stderr"); - stdout.setLogLevel(LocationAwareLogger.INFO_INT); - stderr.setLogLevel(LocationAwareLogger.INFO_INT); + int streamLogLevel = switch (context.loggerLevel) { + case DEBUG -> LocationAwareLogger.DEBUG_INT; + case INFO -> LocationAwareLogger.INFO_INT; + case ERROR -> LocationAwareLogger.ERROR_INT; + }; + stdout.setLogLevel(streamLogLevel); + stderr.setLogLevel(streamLogLevel); PrintStream psOut = new LoggingOutputStream(s -> stdout.info("[stdout] " + s)).printStream(); context.closeables.add(() -> LoggingOutputStream.forceFlush(psOut)); PrintStream psErr = new LoggingOutputStream(s -> stderr.warn("[stderr] " + s)).printStream();