I wanted to add a prefix to all my logs. I tried to subclass XCGLogger to override logln(...) or debug(...) functions.
But I am facing two difficulties while using this
- Compiler always give me error (see picture).
- I don't know how to customize the given log message as the parameter is a closure.
Thanks

Ok I found. We need to define a
classorstructthat conforms toLogFormatterProtocoland implement theformat(logDetails: inout LogDetails, message: inout String) -> Stringfunction to modify the inout message. Then create an instance of that class or struct and add it to the destination formatters array :