serokell / log-warper

Logging library to provide more convenient, extremely configurable but simple monadic interface with pretty output
MIT License
19 stars 11 forks source link

Add function that will deal with `forkIO`-like functions #50

Closed vrom911 closed 6 years ago

vrom911 commented 6 years ago

As it was very often pattern I've implemented

forkLogIO :: (MonadIO m, WithLogger m) => LoggerNameBox IO () -> m ThreadId
forkLogIO action = do
    logName <- askLoggerName
    liftIO $ forkIO $ usingLoggerName logName $ action

It would be helpful to have something more common not related only to forkIO.

chshersh commented 6 years ago

@vrom911 This might be helpful! Especially with proper documentation and examples.