module Log.Backend.StandardOutput.Bulk (
withBulkStdOutLogger,
bulkStdoutLogger
) where
import Prelude
import qualified Data.Text.IO as T
import System.IO (hFlush, stdout)
import Log.Data
import Log.Logger
import Log.Internal.Logger
withBulkStdOutLogger :: (Logger -> IO r) -> IO r
withBulkStdOutLogger act = do
logger <- bulkStdoutLogger
withLogger logger act
{-# DEPRECATED bulkStdoutLogger "Use 'withBulkStdOutLogger' instead!" #-}
bulkStdoutLogger :: IO Logger
bulkStdoutLogger = mkBulkLogger "stdout-bulk"
(\msgs -> mapM_ (T.putStrLn . showLogMessage Nothing) msgs
>> hFlush stdout)
(hFlush stdout)