log-warper-1.8.7: Flexible, configurable, monadic and pretty logging

Safe HaskellNone
LanguageHaskell2010

System.Wlog.Concurrent

Description

This module introduces functions that allow to run action in parallel with logging.

Synopsis

Documentation

data WaitingDelta Source #

Data type to represent waiting strategy for printing warnings if action take too much time.

Constructors

WaitOnce (Time Second)

wait s seconds and stop execution

WaitLinear (Time Second)

wait s, s * 2, s * 3 , s * 4 , ... seconds

WaitGeometric (Time Second) RatioNat

wait m, m * q, m * q^2, m * q^3, ... microseconds

type CanLogInParallel m = (MonadBaseControl IO m, WithLoggerIO m) Source #

Constraint for something that can be logged in parallel with other action.

logWarningLongAction :: forall m a. CanLogInParallel m => (Text -> m ()) -> WaitingDelta -> Text -> m a -> m a Source #

Run action and print warning if it takes more time than expected.

logWarningWaitOnce :: CanLogInParallel m => Time Second -> Text -> m a -> m a Source #

Specialization of logWarningLongAction with WaitOnce.

logWarningWaitLinear :: CanLogInParallel m => Time Second -> Text -> m a -> m a Source #

Specialization of logWarningLongAction with WaiLinear.

logWarningWaitInf :: CanLogInParallel m => Time Second -> Text -> m a -> m a Source #

Specialization of logWarningLongAction with WaitGeometric with parameter 1.3. Accepts Second.