File tree Expand file tree Collapse file tree 1 file changed +2
-0
lines changed Expand file tree Collapse file tree 1 file changed +2
-0
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,8 @@ val logger = Logger[MyClass]
75
75
The ` LazyLogging ` and ` StrictLogging ` traits from the ` com.typesafe.scalalogging ` package define the ` logger ` member as
76
76
a lazy or strict value respectively, whereas the ` AnyLogging ` trait defines an abstract ` logger ` .
77
77
78
+ It depends on the individual use case which trait to use. However, we have defined some scenarios where you can use these traits:
79
+
78
80
- Use ` LazyLogging ` if you are creating lots of objects with this trait repetitively.
79
81
- Use ` StrictLogging ` pretty much by default, especially if the class is a singleton, or you know the log methods will always be invoked.
80
82
- Use ` AnyLogging ` when writing some trait which needs access to any logger without deciding on a specific implementation.
You can’t perform that action at this time.
0 commit comments