Safe Haskell | None |
---|---|
Language | Haskell2010 |
- brackets :: Builder -> Builder
- getKeys :: LogItem s => Verbosity -> s -> [Builder]
- data ColorStrategy
- mkHandleScribe :: ColorStrategy -> Handle -> Severity -> Verbosity -> IO Scribe
- mkFileScribe :: FilePath -> Severity -> Verbosity -> IO Scribe
- formatItem :: LogItem a => Bool -> Verbosity -> Item a -> Builder
- ioLogEnv :: Severity -> Verbosity -> IO LogEnv
Documentation
data ColorStrategy Source #
ColorLog Bool | Whether to use color control chars in log output |
ColorIfTerminal | Color if output is a terminal |
mkHandleScribe :: ColorStrategy -> Handle -> Severity -> Verbosity -> IO Scribe Source #
Logs to a file handle such as stdout, stderr, or a file. Contexts and other information will be flattened out into bracketed fields. For example:
[2016-05-11 21:01:15][MyApp][Info][myhost.example.com][1724][ThreadId 1154][main:Helpers.Logging Helpers/Logging.hs:32:7] Started [2016-05-11 21:01:15][MyApp.confrabulation][Debug][myhost.example.com][1724][ThreadId 1154][confrab_factor:42.0][main:Helpers.Logging Helpers/Logging.hs:41:9] Confrabulating widgets, with extra namespace and context [2016-05-11 21:01:15][MyApp][Info][myhost.example.com][1724][ThreadId 1154][main:Helpers.Logging Helpers/Logging.hs:43:7] Namespace and context are back to normal
Returns the newly-created Scribe
. The finalizer flushes the
handle. Handle mode is set to LineBuffering
automatically.
mkFileScribe :: FilePath -> Severity -> Verbosity -> IO Scribe Source #
A specialization of mkHandleScribe
that takes a FilePath
instead of a Handle
. It is responsible for opening the file in
AppendMode
and will close the file handle on
'closeScribe'/'closeScribes'. Does not do log coloring. Sets handle
to LineBuffering
mode.