Debugging and entering the elevator using SBT

I am trying to get basic logging and debugging while working in Lift using SBT. Im uses Eclipse as an editor, but does all the compilation with SBT. Can anyone suggest how to print debug statements / logging in SBT console?

+5
source share
2 answers

If you want to log using Logback, you need to create a basic xml file with the name src/main/resources/props/default.logback.xml(the file name may differ from the development and production environment, but it’s easy to save it).

In this file, the main configuration that will be written to the console is as follows:

<configuration>
  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
    <encoder>
      <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
    </encoder>
  </appender>

  <root level="debug">
    <appender-ref ref="STDOUT" />
  </root>
</configuration>

( .)

"ch.qos.logback" % "logback-classic" % "0.9.26"

sbt.

, , Logger, debug, info, warn,... .

class SomeClass extends SomeOtherClass with Logger {
    debug("Class initialised.")
}

, , Loggable, - Logger.

class SomeClass extends SomeOtherClass with Loggable {
    logger.debug("Class initialised.")
}

. wiki.

+5

sbt , - . , , , , , .

+1

All Articles