[Suggestion] LoggerFactory.default as a default parameter for newLogger()
tom5079 opened this issue · 2 comments
Hello,
I recently started using this library and I noticed that I quite repetitively use newLogger(LoggerFactory.default)
Because it's "default", can we make it a default parameter so we can use it with just newLogger()
?
Thank you for the awesome library by the way :)
Hi !
Happy you like the lib :)
I don't think that's a very good idea, because it would make it easy to mistakenly use default in an application that uses a custom configuration.
What I usually do in my apps is:
val appLoggerFactory = LoggerFactory(defaultLogFrontend.withShortPackageKeepLast(2))
public inline fun <reified T> T.newAppLogger(): Logger = newLogger(appLoggerFactory)
...and use newAppLogger
everywhere in the application.
If newLogger
took a default argument, it would encourage developers in my team to mistakingly use it rather than looking for the correct newAppLogger
.
Thanks! That sounds like a good idea.
I'm closing this issue.