log-warper-1.8.1: Flexible, configurable, monadic and pretty logging

Copyright(c) Serokell 2016
LicenseGPL-3 (see the file LICENSE)
MaintainerSerokell <hi@serokell.io>
PortabilityPOSIX, GHC
Safe HaskellNone



Logging functionality. This module is wrapper over hslogger, which allows to keep logger name in monadic context.



initTerminalLogging Source #


:: MonadIO m 
=> (UTCTime -> Text) 
-> (Handle -> Text -> IO ()) 
-> Bool

Show time?

-> Bool

Show ThreadId?

-> Maybe Severities 
-> Maybe Severities 
-> m () 

This function initializes global logging system for terminal output. At high level, it sets severity which will be used by all loggers by default, sets default formatters and sets custom severity for given loggers (if any).

NOTE: you probably don't want to use this function. Consider setupLogging.

On a lower level it does the following: 1. Removes default handler from root logger, sets two handlers such that: 1.1. All messages are printed to stdout. 1.2. Moreover messages with at least Error severity are printed to stderr. 2. Sets given Severity to root logger, so that it will be used by descendant loggers by default. 3. Applies setSeverity to given loggers. It can be done later using setSeverity directly.