You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- SLF4J loggers and our Logger now survive serialization. By survive serialization, we mean that the
138
149
deserialized logger instances are fully functional.
139
150
151
+
## String Interpolation
152
+
It is idiomatic to use Scala's string interpolation `logger.error(s"log $value")` instead of SLF4J string interpolation `logger.error("log {}", value)`.
153
+
However there are some tools (such as [Sentry](https://sentry.io)) that use the log message format as grouping key. Therefore they do not work well with
154
+
Scala's string interpolation.
155
+
156
+
Scala Logging replaces simple string interpolations with their SLF4J counterparts like this:
This has no effect on behavior and performace should be comparable (depends on the underlying logging library).
167
+
168
+
### Limitations
169
+
- Works only when string interpolation is directly used inside the logging statement. That is when the log message is static (available at compile time).
170
+
- Works only for the `logger.<level>(message)` and `logger.<level>(marker, message)` logging methods. It does not work if you want to log an exception and
171
+
use string interpolation too (this is a limitation of the SLF4J API).
172
+
140
173
## Line numbers in log message?
141
174
142
175
Using the [sourcecode](https://github.com/lihaoyi/sourcecode#logging) library, it's possible to add line number
0 commit comments