hslogger-1.3.2.0: Versatile logging framework

Copyright | Copyright (C) 2004-2011 John Goerzen
License | BSD3
Portability | portable
Safe Haskell | Safe-Inferred
Language | Haskell2010

System.Log.Handler

Contents

- Basic Types

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, jgoerzen@complete.org

Synopsis

- 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 where Source #

All log handlers should adhere to this.

This is the base class for the various log handlers. They should all adhere to this class.

Minimal complete definition

setLevel, getLevel, setFormatter, emit, close

Methods

setLevel :: a -> Priority -> a Source #

Sets the log level. `handle` will drop items beneath this level.

getLevel :: a -> Priority Source #

Gets the current level.

setFormatter :: a -> LogFormatter a -> a Source #

Set a log formatter to customize the log format for this Handler

getFormatter :: a -> LogFormatter a Source #

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.

close :: a -> IO () Source #

Closes the logging system, causing it to close any open files, etc.

#### Instances

Instances details

LogHandler SyslogHandler Source # |

Instance details

Defined in System.Log.Handler.Syslog

Methods

setLevel :: SyslogHandler -> Priority -> SyslogHandler Source #

getLevel :: SyslogHandler -> Priority Source #

setFormatter :: SyslogHandler -> LogFormatter SyslogHandler -> SyslogHandler Source #

getFormatter :: SyslogHandler -> LogFormatter SyslogHandler Source #

handle :: SyslogHandler -> LogRecord -> String -> IO () Source #

emit :: SyslogHandler -> LogRecord -> String -> IO () Source #

close :: SyslogHandler -> IO () Source #

LogHandler (GenericHandler a) Source # |

Instance details

Defined in System.Log.Handler.Simple

Methods

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 #