kazu-yamamoto / logger

A fast logging system for Haskell
159 stars 68 forks source link

log to a chan #74

Closed ghost closed 8 years ago

ghost commented 8 years ago

This change allows you to log to a channel so that you can more easily use monad-logger with a library that exposes its own logging interface (eg, haxy, http-server).

I made this change because in my program stdout/stderr weren't line-buffered, and logging messages were interlacing. The channel resolves log message ordering from threads and unChanLoggingT allows you to extract them all in one place for whatever run*LoggingT.

Here's an example of how this is used: https://gist.github.com/plredmond/22a0513972b30c14e32f

snoyberg commented 8 years ago

Merged and released