-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Write logs in the df1 format using the di logging framework
--   
--   Write logs in the df1 format using the di logging framework.
@package di-df1
@version 1.0.2


-- | This module extends extends the <i>di logging ecosystem</i> with
--   support for the <a>df1</a> hierarchical structured logging format.
--   
--   Particularly, it exports <a>df1</a> for rendering <i>df1</i>-formatted
--   logs, an extension to the <a>Di.Core</a> API with vocabulary specific
--   to <i>df1</i>, and functions like <a>fromDiLog</a> or
--   <a>fromDf1Log</a> to convert back and forth between <i>di</i> and
--   <i>df1</i> types.
--   
--   The <a>Di.Df1.Monad</a> module belonging to this same package exports
--   an extension to the <a>Di.Monad</a> API, rather than to
--   <a>Di.Core</a>.
--   
--   Consider this a preview release: The API is likely to stay stable, but
--   extensive testing, formalization and tooling is due.
module Di.Df1

-- | Convenience type-synonym for a <a>Di</a> restricted to all the
--   <i>df1</i> monomorphic types.
--   
--   <pre>
--   <a>Df1</a> == <a>Di</a> <a>Level</a> <a>Path</a> <a>Message</a>
--      :: *
--   </pre>
--   
--   This type-synonym is not used within the <tt>di-df1</tt> library
--   itself because all functions exposed in the library have more general
--   types. However, users are encouraged to use <a>Df1</a> if they find it
--   useful to reduce boilerplate and improve type inferrence.
type Df1 = Di Level Path Message

-- | Push a new <a>Segment</a> to the <a>Di</a>
push :: Segment -> Di level Path msg -> Di level Path msg

-- | Push a new attribute <a>Key</a> and <a>Value</a> to the <a>Di</a>.
attr :: Key -> Value -> Di level Path msg -> Di level Path msg

-- | Log a message intended to be useful only when deliberately debugging a
--   program.
debug :: MonadIO m => Di Level path Message -> Message -> m ()

-- | Log an informational message.
info :: MonadIO m => Di Level path Message -> Message -> m ()

-- | Log a condition that is not an error, but should possibly be handled
--   specially.
notice :: MonadIO m => Di Level path Message -> Message -> m ()

-- | Log a warning condition, such as an exception being gracefully handled
--   or some missing configuration setting being assigned a default value.
warning :: MonadIO m => Di Level path Message -> Message -> m ()

-- | Log an error condition, such as an unhandled exception.
error :: MonadIO m => Di Level path Message -> Message -> m ()

-- | Log a condition that should be corrected immediately, such as a
--   corrupted database.
alert :: MonadIO m => Di Level path Message -> Message -> m ()

-- | Log a critical condition that could result in system failure, such as
--   a disk running out of space.
critical :: MonadIO m => Di Level path Message -> Message -> m ()

-- | Log a message stating that the system is unusable.
emergency :: MonadIO m => Di Level path Message -> Message -> m ()

-- | Log a message intended to be useful only when deliberately debugging a
--   program.
debug' :: Monad m => (forall x. STM x -> m x) -> Di Level path Message -> Message -> m ()

-- | Log an informational message.
info' :: Monad m => (forall x. STM x -> m x) -> Di Level path Message -> Message -> m ()

-- | Log a condition that is not an error, but should possibly be handled
--   specially.
notice' :: Monad m => (forall x. STM x -> m x) -> Di Level path Message -> Message -> m ()

-- | Log a warning condition, such as an exception being gracefully handled
--   or some missing configuration setting being assigned a default value.
warning' :: Monad m => (forall x. STM x -> m x) -> Di Level path Message -> Message -> m ()

-- | Log an error condition, such as an unhandled exception.
error' :: Monad m => (forall x. STM x -> m x) -> Di Level path Message -> Message -> m ()

-- | Log a condition that should be corrected immediately, such as a
--   corrupted database.
alert' :: Monad m => (forall x. STM x -> m x) -> Di Level path Message -> Message -> m ()

-- | Log a critical condition that could result in system failure, such as
--   a disk running out of space.
critical' :: Monad m => (forall x. STM x -> m x) -> Di Level path Message -> Message -> m ()

-- | Log a message stating that the system is unusable.
emergency' :: Monad m => (forall x. STM x -> m x) -> Di Level path Message -> Message -> m ()

-- | A <tt>LineRenderer</tt> to be used with tools like <a>handle</a> or
--   <a>stderr</a> from the <a>Di.Handle</a> module.
df1 :: LineRenderer Level Path Message

-- | Convert a <a>Log</a> from <a>Df1</a> to a <a>Log</a> from
--   <a>Di.Core</a>.
--   
--   <pre>
--   <a>fromDiLog</a> . <a>fromDf1Log</a>  ==  <a>id</a>
--   </pre>
--   
--   <pre>
--   <a>fromDf1Log</a> . <a>fromDiLog</a>  ==  <a>id</a>
--   </pre>
fromDiLog :: Log Level Path Message -> Log

-- | Convert a <a>Log</a> from <a>Di.Core</a> to a <a>Log</a> from
--   <a>Df1</a>.
--   
--   <pre>
--   <a>fromDiLog</a> . <a>fromDf1Log</a>  ==  <a>id</a>
--   </pre>
--   
--   <pre>
--   <a>fromDf1Log</a> . <a>fromDiLog</a>  ==  <a>id</a>
--   </pre>
fromDf1Log :: Log -> Log Level Path Message


-- | This module exports an API compatible with <a>Di.Monad</a>.
module Di.Df1.Monad

-- | Convenience type-synonym for a <a>DiT</a> restricted to all the
--   <i>df1</i> monomorphic types.
--   
--   <pre>
--   <a>Df1T</a> == <a>DiT</a> <a>Level</a> <a>Path</a> <a>Message</a>
--      :: (* -&gt; *) -&gt; * -&gt; *
--   
--   <a>Df1T</a> m == <a>DiT</a> <a>Level</a> <a>Path</a> <a>Message</a> m
--      :: * -&gt; *
--   
--   <a>Df1T</a> m a == <a>DiT</a> <a>Level</a> <a>Path</a> <a>Message</a> m a
--      :: *
--   </pre>
--   
--   This type-synonym is not used within the <tt>di-df1</tt> library
--   itself because all functions exposed in the library have more general
--   types. However, users are encouraged to use <a>MonadDf1</a> if they
--   find it useful to reduce boilerplate and improve type inferrence.
type Df1T = DiT Level Path Message

-- | Convenience type-synonym for a <a>MonadDi</a> restricted to all the
--   <i>df1</i> monomorphic types.
--   
--   <pre>
--   <a>MonadDf1</a> == <a>MonadDi</a> <a>Level</a> <a>Path</a> <a>Message</a>
--      :: (* -&gt; *) -&gt; <a>Constraint</a>
--   
--   <a>MonadDf1</a> m == <a>MonadDi</a> <a>Level</a> <a>Path</a> <a>Message</a> m
--      :: <a>Constraint</a>
--   </pre>
--   
--   This type-synonym is not used within the <tt>di-df1</tt> library
--   itself because all functions exposed in the library have more general
--   types. However, users are encouraged to use <a>MonadDf1</a> if they
--   find it useful to reduce boilerplate and improve type inferrence.
type MonadDf1 = MonadDi Level Path Message

-- | Push a new <a>Segment</a> to the <a>MonadDi</a>.
push :: MonadDi level Path msg m => Segment -> m a -> m a

-- | Push a new attribute <a>Key</a> and <a>Value</a> to the
--   <a>MonadDi</a>.
attr :: MonadDi level Path msg m => Key -> Value -> m a -> m a

-- | Log a message intended to be useful only when deliberately debugging a
--   program.
debug :: MonadDi Level path Message m => Message -> m ()

-- | Log an informational message.
info :: MonadDi Level path Message m => Message -> m ()

-- | Log a condition that is not an error, but should possibly be handled
--   specially.
notice :: MonadDi Level path Message m => Message -> m ()

-- | Log a warning condition, such as an exception being gracefully handled
--   or some missing configuration setting being assigned a default value.
warning :: MonadDi Level path Message m => Message -> m ()

-- | Log an error condition, such as an unhandled exception.
error :: MonadDi Level path Message m => Message -> m ()

-- | Log a condition that should be corrected immediately, such as a
--   corrupted database.
alert :: MonadDi Level path Message m => Message -> m ()

-- | Log a critical condition that could result in system failure, such as
--   a disk running out of space.
critical :: MonadDi Level path Message m => Message -> m ()

-- | Log a message stating that the system is unusable.
emergency :: MonadDi Level path Message m => Message -> m ()
