Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
The MonadLogger
type-class and associated functions.
Synopsis
- data Settings
- type Renderer = ByteString -> DateFormat -> Level -> [Element] -> Builder
- defSettings :: Settings
- logLevel :: Settings -> Level
- setLogLevel :: Level -> Settings -> Settings
- output :: Settings -> Output
- setOutput :: Output -> Settings -> Settings
- format :: Settings -> Maybe DateFormat
- setFormat :: Maybe DateFormat -> Settings -> Settings
- delimiter :: Settings -> ByteString
- setDelimiter :: ByteString -> Settings -> Settings
- setNetStrings :: Bool -> Settings -> Settings
- bufSize :: Settings -> Int
- setBufSize :: Int -> Settings -> Settings
- name :: Settings -> Maybe Text
- setName :: Maybe Text -> Settings -> Settings
- setRenderer :: Renderer -> Settings -> Settings
- renderer :: Settings -> Renderer
- data Level
- data Output
- data DateFormat
- iso8601UTC :: DateFormat
- data Logger
- new :: MonadIO m => Settings -> m Logger
- create :: MonadIO m => Output -> m Logger
- level :: Logger -> Level
- flush :: MonadIO m => Logger -> m ()
- close :: MonadIO m => Logger -> m ()
- clone :: Maybe Text -> Logger -> Logger
- settings :: Logger -> Settings
- class Monad m => MonadLogger m where
- trace :: MonadLogger m => (Msg -> Msg) -> m ()
- debug :: MonadLogger m => (Msg -> Msg) -> m ()
- info :: MonadLogger m => (Msg -> Msg) -> m ()
- warn :: MonadLogger m => (Msg -> Msg) -> m ()
- err :: MonadLogger m => (Msg -> Msg) -> m ()
- fatal :: MonadLogger m => (Msg -> Msg) -> m ()
- module System.Logger.Message
Documentation
type Renderer = ByteString -> DateFormat -> Level -> [Element] -> Builder Source #
Take a custom separator, date format, log level of the event, and render a list of log fields or messages into a builder.
defSettings :: Settings Source #
Default settings:
logLevel
=Debug
output
=StdOut
format
=iso8601UTC
delimiter
= ", "netstrings
= FalsebufSize
=defaultBufSize
name
= NothingreadEnvironment
= True
format :: Settings -> Maybe DateFormat Source #
The time and date format used for the timestamp part of a log line.
delimiter :: Settings -> ByteString Source #
Delimiter string which separates log line parts.
setDelimiter :: ByteString -> Settings -> Settings Source #
setNetStrings :: Bool -> Settings -> Settings Source #
Whether to use netstring encoding for log lines.
{#- DEPRECATED setNetStrings "Use setRendererNetstr or setRendererDefault instead" #-}
setRenderer :: Renderer -> Settings -> Settings Source #
Set a custom renderer.
See setRendererDefault
and setRendererNetstr
for two common special cases.
data DateFormat Source #
Instances
IsString DateFormat Source # | |
Defined in System.Logger.Settings fromString :: String -> DateFormat # |
iso8601UTC :: DateFormat Source #
ISO 8601 date-time format.
create :: MonadIO m => Output -> m Logger Source #
Invokes new
with default settings and the given output as log sink.
clone :: Maybe Text -> Logger -> Logger Source #
Clone the given logger and optionally give it a name
(use Nothing
to clear).
If logLevelOf
returns a custom Level
for this name
then the cloned logger will use it for its log messages.
trace :: MonadLogger m => (Msg -> Msg) -> m () Source #
Abbreviation for MonadLogger
using the corresponding log level.
debug :: MonadLogger m => (Msg -> Msg) -> m () Source #
Abbreviation for MonadLogger
using the corresponding log level.
info :: MonadLogger m => (Msg -> Msg) -> m () Source #
Abbreviation for MonadLogger
using the corresponding log level.
warn :: MonadLogger m => (Msg -> Msg) -> m () Source #
Abbreviation for MonadLogger
using the corresponding log level.
err :: MonadLogger m => (Msg -> Msg) -> m () Source #
Abbreviation for MonadLogger
using the corresponding log level.
fatal :: MonadLogger m => (Msg -> Msg) -> m () Source #
Abbreviation for MonadLogger
using the corresponding log level.
module System.Logger.Message