Closed PierreR closed 9 years ago
The best I can come up with is:
stdoutHandler p = setFormatter
<$> streamHandler stdout p
<*> pure (simpleLogFormatter "$prio: $msg")
setupLogger = do
hs <- for [LOG.DEBUG, LOG.INFO, LOG.NOTICE, LOG.WARNING] stdoutHandler
LOG.updateGlobalLogger loggerName $ LOG.setHandlers hs
It seems good enough for me.
It probably makes sense to do this for both Puppet.Daemon
and Hiera.Server
logger ?
What do you think ?
Let me know if the fix is OK or not.
Cheers
Seems OK to me !
I would like to add this snippet to the Daemon:
It works nicely and I have found the output to be clearer.
Still it is a bit odd that I do it just for 'WARNING'. Do you know a better way to do this ? Do I really need to create one
f
for each priority ?Another option is to append
p
when wemapM_
but this is a bit at odd with how a logger is supposed to be used.