gfc-logging
![Coverage Status](https://camo.githubusercontent.com/3af107bcef9c1d4bde7fded1d0606a12c5f1cb694c2252540c7473fa164cfde3/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6766632d636f6c6c6563746976652f6766632d6c6f6767696e672f62616467652e7376673f6272616e63683d6d617374657226736572766963653d676974687562)
A library that contains logging related scala utility classes. A fork and new home of the now unmaintained Gilt Foundation Classes (com.gilt.gfc
), now called the GFC Collective, maintained by some of the original authors.
Getting gfc-logging
The latest version is 1.0.0, released on 21/Jan/2020 and cross-built against Scala 2.12.x and 2.13.x.
If you're using SBT, add the following line to your build file:
libraryDependencies += "org.gfccollective" %% "gfc-logging" % "1.0.0"
For Maven and other build tools, you can visit search.maven.org. (This search will also list other available libraries from the GFC Collective.)
Contents and Example Usage
org.gfccollective.logging.Loggable
The org.gfccollective.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
Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0