Skip to content

Commit

Permalink
Send ScalaNativeWorker logging to stderr (#4418)
Browse files Browse the repository at this point in the history
Some log levels for the ScalaNativeWorker were writing to stdout instead
of stderr, this switches those over to stderr.
Closes #4409

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Li Haoyi <haoyi.sg@gmail.com>
  • Loading branch information
3 people authored Jan 28, 2025
1 parent 1c92d8f commit 714c42b
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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")
)

Expand Down

0 comments on commit 714c42b

Please sign in to comment.