Copyright | (c) Serokell 2016 |
---|---|
License | GPL-3 (see the file LICENSE) |
Maintainer | Serokell <[email protected]> |
Stability | experimental |
Portability | POSIX, GHC |
Safe Haskell | None |
Language | Haskell2010 |
System.Wlog.Terminal
Description
Logging functionality. This module is wrapper over hslogger, which allows to keep logger name in monadic context.
- initTerminalLogging :: MonadIO m => (UTCTime -> Text) -> (Handle -> Text -> IO ()) -> Bool -> Bool -> Maybe Severities -> Maybe Severities -> m ()
Documentation
Arguments
:: 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.