on master help sign in
Add example handle scribe output.

This resolves #23

commitd9ae92ffd3ba2efedc3aca7dd2032edea7398710 authorMichael Xavier <michael@michaelxavier.net> dateFri 13 May 2016, 11:53 (10 years ago) parent991c8c6
1 file changed+7−1
katip/src/Katip/Scribes/Handle.hs+7−1
katip/src/Katip/Scribes/Handle.hs+7−1
@@ -49,7 +49,13 @@ data ColorStrategy
4949
5050
5151-------------------------------------------------------------------------------
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
5359mkHandleScribe :: ColorStrategy -> Handle -> Severity -> Verbosity -> IO Scribe
5460mkHandleScribe cs h sev verb = do
5561 hSetBuffering h LineBuffering