Skip to content

Commit 679f235

Browse files
prateekatknoldusanalytically
authored andcommitted
Usecase for LazyLogging and StrictLogging
1 parent 744e0f2 commit 679f235

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,12 @@ val logger = Logger[MyClass]
6767
```
6868

6969
The `LazyLogging` and `StrictLogging` traits from the `com.typesafe.scalalogging` package define the `logger` member as
70-
a lazy or strict value respectively. In both cases the underlying SLF4J logger is named according to the class into which
70+
a lazy or strict value respectively.
71+
72+
- Use `LazyLogging` if you are creating lots of objects with this trait repetitively.
73+
- Use `StrictLogging` pretty much by default, especially if the class is a singleton, or you know the log methods will always be invoked.
74+
75+
In both cases the underlying SLF4J logger is named according to the class into which
7176
these traits are mixed:
7277

7378
```scala

0 commit comments

Comments
 (0)