From 3579dd0a9ffb09cf51d3ef8f4ab1e2fe44ebbdc7 Mon Sep 17 00:00:00 2001 From: Dream <42954461+eureka928@users.noreply.github.com> Date: Wed, 4 Mar 2026 02:35:18 -0500 Subject: [PATCH] [2.x] fix: Respect global log level in continuous build watcher (#8864) **Problem** Running `sbt -error ~run` still prints [info] messages from the watcher ("Monitoring source files...", "Build triggered by...", etc). The watcher creates its logger using only the watchLogLevel setting (default Info), ignoring the global log level set via CLI flags like -error or -warn. **Solution** In Continuous.getCallbacks, take the more restrictive of the watchLogLevel and the global log level from State when configuring the watcher appender. Fixes #7355 --- main/src/main/scala/sbt/internal/Continuous.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main/src/main/scala/sbt/internal/Continuous.scala b/main/src/main/scala/sbt/internal/Continuous.scala index e9573a12a..8b1a018bf 100644 --- a/main/src/main/scala/sbt/internal/Continuous.scala +++ b/main/src/main/scala/sbt/internal/Continuous.scala @@ -271,7 +271,9 @@ private[sbt] object Continuous { validateCommands(s, commands) val configs = getAllConfigs(s, commands, dynamicInputs) val appender = ConsoleAppender(channel.name + "-watch", channel.terminal) - val level = configs.minBy(_.watchSettings.logLevel).watchSettings.logLevel + val watchLevel = configs.minBy(_.watchSettings.logLevel).watchSettings.logLevel + val globalLevel = s.get(Keys.logLevel.key).getOrElse(Level.Info) + val level = Seq(watchLevel, globalLevel).max context.addAppender(channel.name + "-watch", appender -> level) aggregate( configs,