tinylog-0.8: Simplistic logging using fast-logger.

Safe HaskellNone
LanguageHaskell2010

System.Logger

Description

Small layer on top of fast-logger which adds log-levels and timestamp support (using date-cache) and not much more.

Synopsis

Documentation

data Level Source

Constructors

Trace 
Debug 
Info 
Warn 
Error 
Fatal 

data Output Source

Constructors

StdOut 
StdErr 
Path FilePath 

Instances

data Settings Source

Constructors

Settings 

Fields

logLevel :: Level

messages below this log level will be suppressed

output :: Output

log sink

format :: DateFormat

the timestamp format (use "" to disable timestamps)

delimiter :: ByteString

text to intersperse between fields of a log line

bufSize :: BufSize

how many bytes to buffer before commiting to sink

new :: MonadIO m => Settings -> m Logger Source

Create a new Logger with the given Settings. Please note that the logLevel can be dynamically adjusted by setting the environment variable LOG_LEVEL accordingly. Likewise the buffer size can be dynamically set via LOG_BUFFER.

create :: MonadIO m => Output -> m Logger Source

Invokes new with default settings and the given output as log sink.

level :: Logger -> Level Source

Inspect this logger's threshold.

flush :: MonadIO m => Logger -> m () Source

Force buffered bytes to output sink.

close :: MonadIO m => Logger -> m () Source

Closes the logger.

log :: MonadIO m => Logger -> Level -> (Msg -> Msg) -> m () Source

Logs a message with the given level if greater or equal to the logger's threshold.

trace :: MonadIO m => Logger -> (Msg -> Msg) -> m () Source

Abbreviation of log using the corresponding log level.

debug :: MonadIO m => Logger -> (Msg -> Msg) -> m () Source

Abbreviation of log using the corresponding log level.

info :: MonadIO m => Logger -> (Msg -> Msg) -> m () Source

Abbreviation of log using the corresponding log level.

warn :: MonadIO m => Logger -> (Msg -> Msg) -> m () Source

Abbreviation of log using the corresponding log level.

err :: MonadIO m => Logger -> (Msg -> Msg) -> m () Source

Abbreviation of log using the corresponding log level.

fatal :: MonadIO m => Logger -> (Msg -> Msg) -> m () Source

Abbreviation of log using the corresponding log level.

iso8601UTC :: DateFormat Source

ISO 8601 date-time format.