logger
logger copied to clipboard
Add some helpers
I'd like to add following enhancements:
- generalise
ApacheLoggerActions
from wai-logger to something likeFastLoggerActions
with configurable auto-rotate and auto-log-timestamp capabilities, add these to fast-logger.
Motivation: timestamp logging is absolutely necessary, a lot of librarys doing this in a very inefficient way, for example, logging doing this with a system call and a directly show
. The work you have done in wai-logger is awesome!
- add
runFastLoggerLoggingT :: MonadIO m => FastLoggerActions -> LoggingT m a -> m a
to monad-logger and re-exportFastLoggerActions
related functions from fast-logger.
Motivation: since monad-logger rely on fast-logger, we should provide ways to use it with MonadLogger
.
Are these changes look good to you? I'd like send a pr with those enhancement : )
B.T.W, is there any reason not to update date-cache package with auto-update implementation?
Please give us pull request to show your code.
Michael maintains monad-logger while I maintain fast-logger and wai-logger. Please separate your pull requests for each maintainer. If you mix up, the review process gets harder.
B.T.W, is there any reason not to update date-cache package with auto-update implementation?
date-cache is obsoleted. Warp has date cache by itself now.
A side note: should we make a global simpleTimeCacher? My preference is not but I really need some input here.
Does the global time cacher stay always even in the case where date is not necessary?
Does the global time cacher stay always even in the case where date is not necessary?
That depend on how auto-update implement cache, from what i read from https://github.com/yesodweb/wai/issues/351, cacher will be auto turned off if user don't read it frequently enough.
Yes, you are right.
Ok, i will add a global simpleTimeCacher
to encourage user share cache between loggers, and refract wai-logger based on this. PR will come soon.