tagTransformer
Parameters
tagTransformer
function called for every log with the runtime tag (may be null) and returning the final tag to use (or null to indicate no tag). The default is the identity function ({ it }) which leaves the runtime tag unchanged.
Notes and recommendations:
tagTransformeris invoked on every log call and therefore should be fast and side-effect free.If you want to include a fixed prefix/tag, you can capture it from the surrounding scope:
val logger = ConsoleLogger(tagTransformer = { tag -> if (tag != null) "FIXED-$tag" else "FIXED" })The transformer may return
nullif no tag should be used.
Note: The logger intentionally places className before the "(file:line)" part so IDEs/logcat can make the filename:line clickable.