Adding `setLogFormatter`
Firstly, thanks for creating this library! I really appreciate having a simple logging library for getting stuff up and running quickly.
I'm in a situation where I need to log my messages in JSON format.
Would you accept a patch that adds a setLogFormatter function to this library, which takes as argument a function that is used to format log messages? This would enable the user to supply a function that returns the log message that's ultimately printed via System.Log.FastLogger.pushLogStr.
I figure its type signature would be something along the lines of:
setLogFormatter :: (UTCTime -> LogLevel -> LogSource -> logMsg -> Text) -> IO ()
Do you foresee any challenges regarding this? Also, do you have any requirements regarding the implementation of this, in order for a PR to be accepted by you?
Cheers :)
Sounds like a good idea to me, and within the scope of what this library aims to provide. I can't think of any stringent requirements offhand.
I've found an alternative to JSON logging, so I no longer have the motivation to implement this. But perhaps it makes sense to keep this issue open, in case someone else feels like writing the code?