Skip to content

Commit d149841

Browse files
prateekatknoldusanalytically
authored andcommitted
Added descriprion for AnyLogging in README
1 parent 679f235 commit d149841

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,13 @@ 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.
70+
a lazy or strict value respectively, whereas the `AnyLogging` trait defines an abstract `logger`.
7171

7272
- Use `LazyLogging` if you are creating lots of objects with this trait repetitively.
7373
- Use `StrictLogging` pretty much by default, especially if the class is a singleton, or you know the log methods will always be invoked.
74+
- Use `AnyLogging` when writing some trait which needs access to any logger without deciding on a specific implementation.
7475

75-
In both cases the underlying SLF4J logger is named according to the class into which
76+
In case of `LazyLogging` and `StrictLogging`, the underlying SLF4J logger is named according to the class into which
7677
these traits are mixed:
7778

7879
```scala

0 commit comments

Comments
 (0)