I am using scala-logging. There are two classes LazyLogging and StrictLogging. I see, that the difference between them is that LazyLogging is initialized lazily. What is the purpose of that. When I should use one over the other and why?
trait LazyLogging extends AnyRef Defines logger as a lazy value initialized with an underlying org. slf4j. Logger named according to the class into which this trait is mixed.
Scala-logging is a library that wraps the Simple Logging Facade for Java (SLF4J) in a Scala-friendly library. SLF4J supports many different logging frameworks, including both log4j, which we've covered in an earlier post, and logback a similar framework.
Best always use StrictLogging. LazyLogging for when you want to postpone Logger initialization.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With