scala-logging icon indicating copy to clipboard operation
scala-logging copied to clipboard

LoggerTakingImplicits, extract A on implicits

Open cheatmenot opened this issue 5 years ago • 0 comments

Currently, I am using the LoggerTakingImplicit[A] and CanLog[A] in which A will be a context object used to append custom properties on logs but currently scala-logging doesn't let me use context A outside CanLog[A]. Use case is I need to add an appender and I need to get properties on my context A.

I imagine like this

    val a = Logger.takingImplicit[ContextA](logger)
    val context = a.canLogEv.getA()

or you can just make LoggerTakingImplicitMacro to public and remove the final modifier on LoggerTakingImplicit so we can do it custom. Thanks!

cheatmenot avatar Jan 28 '20 11:01 cheatmenot