log4hs-0.9.0.0: A python logging style log library

Safe HaskellNone
LanguageHaskell2010

Logging.Class

Synopsis

Documentation

class Filterable a where Source #

A class represents a common trait of filtering LogRecords

Methods

filter :: a -> LogRecord -> Bool Source #

Instances
Filterable Filter Source # 
Instance details

Defined in Logging.Filter

Filterable Sink Source # 
Instance details

Defined in Logging.Sink

Methods

filter :: Sink -> LogRecord -> Bool Source #

Filterable a => Filterable [a] Source # 
Instance details

Defined in Logging.Class.Filterable

Methods

filter :: [a] -> LogRecord -> Bool Source #

class (HasType Level a, HasType Filterer a, HasType Format1 a, Typeable a, Eq a) => Handler a where Source #

A type class that abstracts the characteristics of a Handler

Minimal complete definition

emit

Methods

open :: a -> IO () Source #

Initialize the Handler instance

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

Emit log event, prepare log data, and send to bancked.

e.g. 1) Format LogRecord into data in specific format (json, html, etc.), 2) write the data to a file or send the data to a server.

close :: a -> IO () Source #

Terminate the Handler instance

handle :: a -> LogRecord -> IO Bool Source #

Handle LogRecord and decide whether to call emit.

The default implementation is to filter LogRecord by level and Handler's filterer, if rejected, do nothing and return False, otherwise call emit and return True.

Note: You can override the default implementation.

fromHandler :: SomeHandler -> Maybe a Source #

toHandler :: a -> SomeHandler Source #

Instances
Handler SomeHandler Source # 
Instance details

Defined in Logging.Class.Handler

Handler TimeRotatingFileHandler Source # 
Instance details

Defined in Logging.Handler.TimeRotatingFileHandler

Handler StreamHandler Source # 
Instance details

Defined in Logging.Handler.StreamHandler

Handler RotatingFileHandler Source # 
Instance details

Defined in Logging.Handler.RotatingFileHandler

Handler FileHandler Source # 
Instance details

Defined in Logging.Handler.FileHandler

class IsMessage a where Source #

A class for datatypes that can be converted to log message.

Since: 0.8.0

Minimal complete definition

toMessage