System.Log.Handler

hslogger-1.2.10: Versatile logging framework

Copyright | Copyright (C) 2004-2011 John Goerzen
License | BSD3
Maintainer | John Goerzen <jgoerzen@complete.org>
Stability | provisional
Portability | portable
Safe Haskell | Safe
Language | Haskell98

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

# Basic Types

class LogHandler a where #

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 #

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

getLevel :: a -> Priority #

Gets the current level.

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

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

getFormatter :: a -> LogFormatter a #

handle :: a -> LogRecord -> String -> IO () #

Logs an event if it meets the requirements given by the most recent call to `setLevel`.

emit :: a -> LogRecord -> String -> IO () #

Forces an event to be logged regardless of the configured level.

close :: a -> IO () #

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

Instances

LogHandler SyslogHandler # |
Methods setLevel :: SyslogHandler -> Priority -> SyslogHandler # getLevel :: SyslogHandler -> Priority # setFormatter :: SyslogHandler -> LogFormatter SyslogHandler -> SyslogHandler # getFormatter :: SyslogHandler -> LogFormatter SyslogHandler # handle :: SyslogHandler -> LogRecord -> String -> IO () # emit :: SyslogHandler -> LogRecord -> String -> IO () # close :: SyslogHandler -> IO () #
LogHandler (GenericHandler a) # |
Methods setLevel :: GenericHandler a -> Priority -> GenericHandler a # getLevel :: GenericHandler a -> Priority # setFormatter :: GenericHandler a -> LogFormatter (GenericHandler a) -> GenericHandler a # getFormatter :: GenericHandler a -> LogFormatter (GenericHandler a) # handle :: GenericHandler a -> LogRecord -> String -> IO () # emit :: GenericHandler a -> LogRecord -> String -> IO () # close :: GenericHandler a -> IO () #