logger icon indicating copy to clipboard operation
logger copied to clipboard

Add some helpers

Open winterland1989 opened this issue 8 years ago • 8 comments

I'd like to add following enhancements:

  • generalise ApacheLoggerActions from wai-logger to something like FastLoggerActions 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-export FastLoggerActions 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 : )

winterland1989 avatar Apr 13 '16 02:04 winterland1989

B.T.W, is there any reason not to update date-cache package with auto-update implementation?

winterland1989 avatar Apr 13 '16 03:04 winterland1989

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.

kazu-yamamoto avatar Apr 13 '16 05:04 kazu-yamamoto

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.

kazu-yamamoto avatar Apr 13 '16 05:04 kazu-yamamoto

A side note: should we make a global simpleTimeCacher? My preference is not but I really need some input here.

winterland1989 avatar Apr 14 '16 01:04 winterland1989

Does the global time cacher stay always even in the case where date is not necessary?

kazu-yamamoto avatar Apr 14 '16 05:04 kazu-yamamoto

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.

winterland1989 avatar Apr 14 '16 05:04 winterland1989

Yes, you are right.

kazu-yamamoto avatar Apr 14 '16 05:04 kazu-yamamoto

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.

winterland1989 avatar Apr 14 '16 06:04 winterland1989