How can I add silencable logging to my sbt Scala project? -
i'm new @ logging , i've got println
debugging able silence.
i tried scala logging logback (runnable example), i'm surprised can't silence new logger changing sbt log level, e.g. > warn
.
can sbt control logger's log levels?
or should trying use sbt's logger instead?
logback has own configuration file control logging in application. need "logback.xml" in src/main/resources folder configure. below simple example, control log @ levels , below case not print out debug level logs. in addtion, can set complexed loggings such file based logging , more. see http://logback.qos.ch/manual/configuration.html detail
<configuration> <appender name="console" class="ch.qos.logback.core.consoleappender"> <encoder> <pattern>%d{yyyy-mm-dd hh:mm:ss.sss}: %msg%n</pattern> </encoder> </appender> <root level="info"> <appender-ref ref="console" /> </root> </configuration>
Comments
Post a Comment