| Portability | portable |
|---|---|
| Stability | provisional |
| Maintainer | John Goerzen <[email protected]> |
| Safe Haskell | None |
System.Log.Handler
Contents
Description
Definition of log handler support
For some handlers, check out System.Log.Handler.Simple and System.Log.Handler.Syslog.
Please see System.Log.Logger for extensive documentation on the logging system.
Written by John Goerzen, [email protected]
- class LogHandler a where
- setLevel :: a -> Priority -> a
- getLevel :: a -> Priority
- setFormatter :: a -> LogFormatter a -> a
- getFormatter :: a -> LogFormatter a
- handle :: a -> LogRecord -> String -> IO ()
- emit :: a -> LogRecord -> String -> IO ()
- close :: a -> IO ()
Basic Types
class LogHandler a whereSource
All log handlers should adhere to this.
This is the base class for the various log handlers. They should all adhere to this class.
Methods
setLevel :: a -> Priority -> aSource
Sets the log level. handle will drop
items beneath this level.
getLevel :: a -> PrioritySource
Gets the current level.
setFormatter :: a -> LogFormatter a -> aSource
Set a log formatter to customize the log format for this Handler
getFormatter :: a -> LogFormatter aSource
handle :: a -> LogRecord -> String -> IO ()Source
Logs an event if it meets the requirements
given by the most recent call to setLevel.
emit :: a -> LogRecord -> String -> IO ()Source
Forces an event to be logged regardless of the configured level.
Closes the logging system, causing it to close any open files, etc.
Instances
| LogHandler SyslogHandler | |
| LogHandler GrowlHandler | |
| LogHandler (GenericHandler a) |