All Downloads are FREE. Search and download functionalities are using the official Maven repository.

sbt.mill.SbtLoggerUtils.scala Maven / Gradle / Ivy

There is a newer version: 0.12.2-20-231ff6
Show newest version
package sbt.mill

import mill.api.internal
import sbt.internal.util.{Appender, ManagedLogger}
import sbt.util.{Level, LoggerContext}

// We put this in the sbt package so it can access `private[sbt]` methods
@internal
object SbtLoggerUtils {
  def createLogger(name: String, appender: Appender, level: Level.Value): ManagedLogger = {
    val context = LoggerContext.globalContext
    val logger = context.logger(name = name, channelName = None, execId = None)
    context.clearAppenders(name)
    context.addAppender(name, (appender, level))

    logger
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy