From 714c42b5afdf6fe6cff7fa11a54da96a1b6c8a6c Mon Sep 17 00:00:00 2001 From: Brian Tracey Date: Tue, 28 Jan 2025 13:35:33 -0500 Subject: [PATCH] Send ScalaNativeWorker logging to stderr (#4418) Some log levels for the ScalaNativeWorker were writing to stdout instead of stderr, this switches those over to stderr. Closes https://github.com/com-lihaoyi/mill/issues/4409 --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Li Haoyi --- .../scalanativelib/worker/ScalaNativeWorkerImpl.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scalanativelib/worker/0.5/src/mill/scalanativelib/worker/ScalaNativeWorkerImpl.scala b/scalanativelib/worker/0.5/src/mill/scalanativelib/worker/ScalaNativeWorkerImpl.scala index 29a1c008b5b..2c557778c9d 100644 --- a/scalanativelib/worker/0.5/src/mill/scalanativelib/worker/ScalaNativeWorkerImpl.scala +++ b/scalanativelib/worker/0.5/src/mill/scalanativelib/worker/ScalaNativeWorkerImpl.scala @@ -1,7 +1,7 @@ package mill.scalanativelib.worker import java.io.File -import java.lang.System.{err, out} +import java.lang.System.err import mill.scalanativelib.worker.api._ import scala.scalanative.util.Scope @@ -29,9 +29,9 @@ class ScalaNativeWorkerImpl extends mill.scalanativelib.worker.api.ScalaNativeWo def logger(level: NativeLogLevel): Logger = Logger( traceFn = msg => if (level.value >= NativeLogLevel.Trace.value) err.println(s"[trace] $msg"), - debugFn = msg => if (level.value >= NativeLogLevel.Debug.value) out.println(s"[debug] $msg"), - infoFn = msg => if (level.value >= NativeLogLevel.Info.value) out.println(s"[info] $msg"), - warnFn = msg => if (level.value >= NativeLogLevel.Warn.value) out.println(s"[warn] $msg"), + debugFn = msg => if (level.value >= NativeLogLevel.Debug.value) err.println(s"[debug] $msg"), + infoFn = msg => if (level.value >= NativeLogLevel.Info.value) err.println(s"[info] $msg"), + warnFn = msg => if (level.value >= NativeLogLevel.Warn.value) err.println(s"[warn] $msg"), errorFn = msg => if (level.value >= NativeLogLevel.Error.value) err.println(s"[error] $msg") )