Copyright | Copyright (C) 2004-2011 John Goerzen |
---|---|
License | BSD3 |
Maintainer | John Goerzen <jgoerzen@complete.org> |
Stability | provisional |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell98 |
Simple log handlers
Written by John Goerzen, jgoerzen@complete.org
Synopsis
- streamHandler :: Handle -> Priority -> IO (GenericHandler Handle)
- fileHandler :: FilePath -> Priority -> IO (GenericHandler Handle)
- data GenericHandler a = GenericHandler {}
- verboseStreamHandler :: Handle -> Priority -> IO (GenericHandler Handle)
Documentation
streamHandler :: Handle -> Priority -> IO (GenericHandler Handle) Source #
Create a stream log handler. Log messages sent to this handler will
be sent to the stream used initially. Note that the close
method
will have no effect on stream handlers; it does not actually close
the underlying stream.
fileHandler :: FilePath -> Priority -> IO (GenericHandler Handle) Source #
Create a file log handler. Log messages sent to this handler
will be sent to the filename specified, which will be opened
in Append mode. Calling close
on the handler will close the file.
data GenericHandler a Source #
A helper data type.
Instances
LogHandler (GenericHandler a) Source # | |
Defined in System.Log.Handler.Simple setLevel :: GenericHandler a -> Priority -> GenericHandler a Source # getLevel :: GenericHandler a -> Priority Source # setFormatter :: GenericHandler a -> LogFormatter (GenericHandler a) -> GenericHandler a Source # getFormatter :: GenericHandler a -> LogFormatter (GenericHandler a) Source # handle :: GenericHandler a -> LogRecord -> String -> IO () Source # emit :: GenericHandler a -> LogRecord -> String -> IO () Source # close :: GenericHandler a -> IO () Source # |
verboseStreamHandler :: Handle -> Priority -> IO (GenericHandler Handle) Source #
Like streamHandler
, but note the priority and logger name along
with each message.