on master help sign in
Add example handle scribe output.
d9ae92fMichael Xavier
katip/src/Katip/Scribes/Handle.hs+7−1
@@ -49,7 +49,13 @@ data ColorStrategy
49
49
50
50
51-------------------------------------------------------------------------------
51-------------------------------------------------------------------------------
52−-- | Logs to a file handle such as stdout, stderr, or a file.
52+-- | Logs to a file handle such as stdout, stderr, or a file. Contexts
53+-- and other information will be flattened out into bracketed
54+-- fields. For example:
55+--
56+-- > [2016-05-11 21:01:15][MyApp][Info][myhost.example.com][1724][ThreadId 1154][main:Helpers.Logging Helpers/Logging.hs:32:7] Started
57+-- > [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
58+-- > [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
53mkHandleScribe :: ColorStrategy -> Handle -> Severity -> Verbosity -> IO Scribe
59mkHandleScribe :: ColorStrategy -> Handle -> Severity -> Verbosity -> IO Scribe
54mkHandleScribe cs h sev verb = do
60mkHandleScribe cs h sev verb = do
55 hSetBuffering h LineBuffering
61 hSetBuffering h LineBuffering