di-df1-1.0.2: Write logs in the df1 format using the di logging framework

Safe HaskellNone
LanguageHaskell2010

Di.Df1

Contents

Description

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.

Synopsis

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

push Source #

Arguments

:: Segment 
-> Di level Path msg 
-> Di level Path msg 

Push a new Segment to the Di

Metadata

attr Source #

Arguments

:: Key 
-> Value 
-> Di level Path msg 
-> Di level Path msg 

Push a new attribute Key and Value to the Di.

Messages

debug :: MonadIO m => Di Level path Message -> Message -> m () Source #

Log a message intended to be useful only when deliberately debugging a program.

info :: MonadIO m => Di Level path Message -> Message -> m () Source #

Log an informational message.

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.

Di.Handle support

df1 :: LineRenderer Level Path Message Source #

A LineRenderer to be used with tools like handle or stderr from the Di.Handle module.

Conversion