di-df1-1.0: 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

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.

debug == log Debug

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

Log an informational message.

info == log Info

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

Log a condition that is not an error, but should possibly be handled specially.

notice == log Notice

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.

warning == log Warning

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

Log an error condition, such as an unhandled exception.

error == log Error

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

Log a condition that should be corrected immediately, such as a corrupted database.

alert == log Alert

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.

critical == log Critical

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

Log a message stating that the system is unusable.

emergency == log Emergency

Non MonadIO variants

debug' :: MonadIO 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.

debug' == log' Debug

info' :: MonadIO m => (forall x. STM x -> m x) -> Di Level path Message -> Message -> m () Source #

Log an informational message.

info' == log' Info

notice' :: MonadIO 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.

notice' == log' Notice

warning' :: MonadIO 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.

warning' == log' Warning

error' :: MonadIO m => (forall x. STM x -> m x) -> Di Level path Message -> Message -> m () Source #

Log an error condition, such as an unhandled exception.

error' == log' Error

alert' :: MonadIO 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.

alert' == log' Alert

critical' :: MonadIO 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.

critical' == log' Critical

emergency' :: MonadIO m => (forall x. STM x -> m x) -> Di Level path Message -> Message -> m () Source #

Log a message stating that the system is unusable.

emergency' == log' Emergency

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