gfc-logging
A library that contains logging related scala utility classes. Part of the Gilt Foundation Classes.
Getting gfc-logging
The latest version is 0.0.8, which is cross-built against Scala 2.10.x, 2.11.x and 2.12.x.
If you're using SBT, add the following line to your build file:
libraryDependencies += "com.gilt" %% "gfc-logging" % "0.0.8"
For Maven and other build tools, you can visit search.maven.org. (This search will also list other available libraries from the gilt fundation classes.)
Contents and Example Usage
com.gilt.gfc.logging.Loggable
The com.gilt.gfc.logging.Loggable trait can be mixed in to add a logger instance to a type that uses slf4j to abstract the underlying logging framework and supports lazy log message computation.
A logger instance with each instance of this trait:
trait SomeTrait extends AnotherTrait with Loggable {
def logSomething: Unit = {
info("This " + "String" + " is " + "constructed" + " lazily")
}
}
A logger singleton for all instances of the companion class:
object SomeThing extends OpenLoggable
class SomeThing {
import SomeThing._
def logSomething: Unit = {
info("This " + "String" + " is " + "constructed" + " lazily")
}
}
License
Copyright 2018 Gilt Groupe, Inc.
Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0