Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module extends extends the di logging ecosystem with support for the df1 hierarchical structured logging format.
Particularly, it exports df1
for rendering df1-formatted logs, an
extension to the Di.Core API with vocabulary specific to df1, and
functions like fromDiLog
or fromDf1Log
to convert back and forth between
di and df1 types.
The Di.Df1.Monad module belonging to this same package exports an extension to the Di.Monad API, rather than to Di.Core.
Consider this a preview release: The API is likely to stay stable, but extensive testing, formalization and tooling is due.
- type Df1 = Di Level Path Message
- push :: Segment -> Di level Path msg -> Di level Path msg
- attr :: Key -> Value -> Di level Path msg -> Di level Path msg
- debug :: MonadIO m => Di Level path Message -> Message -> m ()
- info :: MonadIO m => Di Level path Message -> Message -> m ()
- notice :: MonadIO m => Di Level path Message -> Message -> m ()
- warning :: MonadIO m => Di Level path Message -> Message -> m ()
- error :: MonadIO m => Di Level path Message -> Message -> m ()
- alert :: MonadIO m => Di Level path Message -> Message -> m ()
- critical :: MonadIO m => Di Level path Message -> Message -> m ()
- emergency :: MonadIO m => Di Level path Message -> Message -> m ()
- debug' :: Monad m => (forall x. STM x -> m x) -> Di Level path Message -> Message -> m ()
- info' :: Monad m => (forall x. STM x -> m x) -> Di Level path Message -> Message -> m ()
- notice' :: Monad m => (forall x. STM x -> m x) -> Di Level path Message -> Message -> m ()
- warning' :: Monad m => (forall x. STM x -> m x) -> Di Level path Message -> Message -> m ()
- error' :: Monad m => (forall x. STM x -> m x) -> Di Level path Message -> Message -> m ()
- alert' :: Monad m => (forall x. STM x -> m x) -> Di Level path Message -> Message -> m ()
- critical' :: Monad m => (forall x. STM x -> m x) -> Di Level path Message -> Message -> m ()
- emergency' :: Monad m => (forall x. STM x -> m x) -> Di Level path Message -> Message -> m ()
- df1 :: LineRenderer Level Path Message
- fromDiLog :: Log Level Path Message -> Log
- fromDf1Log :: Log -> Log Level Path Message
Documentation
type Df1 = Di Level Path Message Source #
Convenience type-synonym for a Di
restricted to all the df1
monomorphic types.
Df1
==Di
Level
Path
Message
:: *
This type-synonym is not used within the di-df1
library itself because
all functions exposed in the library have more general types. However,
users are encouraged to use Df1
if they find it useful to reduce
boilerplate and improve type inferrence.
Hierarchy
Metadata
Messages
debug :: MonadIO m => Di Level path Message -> Message -> m () Source #
Log a message intended to be useful only when deliberately debugging a program.
notice :: MonadIO m => Di Level path Message -> Message -> m () Source #
Log a condition that is not an error, but should possibly be handled specially.
warning :: MonadIO m => Di Level path Message -> Message -> m () Source #
Log a warning condition, such as an exception being gracefully handled or some missing configuration setting being assigned a default value.
error :: MonadIO m => Di Level path Message -> Message -> m () Source #
Log an error condition, such as an unhandled exception.
alert :: MonadIO m => Di Level path Message -> Message -> m () Source #
Log a condition that should be corrected immediately, such as a corrupted database.
critical :: MonadIO m => Di Level path Message -> Message -> m () Source #
Log a critical condition that could result in system failure, such as a disk running out of space.
emergency :: MonadIO m => Di Level path Message -> Message -> m () Source #
Log a message stating that the system is unusable.
Non MonadIO
variants
debug' :: Monad m => (forall x. STM x -> m x) -> Di Level path Message -> Message -> m () Source #
Log a message intended to be useful only when deliberately debugging a program.
info' :: Monad m => (forall x. STM x -> m x) -> Di Level path Message -> Message -> m () Source #
Log an informational message.
notice' :: Monad m => (forall x. STM x -> m x) -> Di Level path Message -> Message -> m () Source #
Log a condition that is not an error, but should possibly be handled specially.
warning' :: Monad m => (forall x. STM x -> m x) -> Di Level path Message -> Message -> m () Source #
Log a warning condition, such as an exception being gracefully handled or some missing configuration setting being assigned a default value.
error' :: Monad m => (forall x. STM x -> m x) -> Di Level path Message -> Message -> m () Source #
Log an error condition, such as an unhandled exception.
alert' :: Monad m => (forall x. STM x -> m x) -> Di Level path Message -> Message -> m () Source #
Log a condition that should be corrected immediately, such as a corrupted database.
critical' :: Monad m => (forall x. STM x -> m x) -> Di Level path Message -> Message -> m () Source #
Log a critical condition that could result in system failure, such as a disk running out of space.
emergency' :: Monad m => (forall x. STM x -> m x) -> Di Level path Message -> Message -> m () Source #
Log a message stating that the system is unusable.