fused-effects-logging-0.1.0.0: fused-effects-logging - a logging library for fused-effects
Safe HaskellSafe-Inferred
LanguageGHC2021

Control.Effect.Logging

Description

a Logging effect and utility functions using it

Synopsis

logging log messages as an effect

data LogMsg where Source #

a single line of a logging message

Constructors

MkLogMsg 

Fields

  • :: ToLogStr msg
     
  • => { loc :: !Loc

    The location of the code that is logging this

  •    , lvl :: !LogLevel

    the log level of this function

  •    , msg :: !msg

    the message that is being put into the log

  •    } -> LogMsg
     

data Logging m r where Source #

the logging effect

Constructors

LoggerLog :: !LogMsg -> Logging m () 

Instances

Instances details
(Algebra sig m, MonadIO m) => Algebra (Logging :+: sig) (GenericLoggingC m) Source # 
Instance details

Defined in Control.Carrier.Logging.Generic

Methods

alg :: forall ctx (n :: Type -> Type) a. Functor ctx => Handler ctx n (GenericLoggingC m) -> (Logging :+: sig) n a -> ctx () -> GenericLoggingC m (ctx a) #

(Algebra sig m, MonadIO m) => Algebra (Logging :+: sig) (RefLoggingC m) Source # 
Instance details

Defined in Control.Carrier.Logging.Ref

Methods

alg :: forall ctx (n :: Type -> Type) a. Functor ctx => Handler ctx n (RefLoggingC m) -> (Logging :+: sig) n a -> ctx () -> RefLoggingC m (ctx a) #

Algebra sig m => Algebra (Logging :+: sig) (SilentLoggingC m) Source # 
Instance details

Defined in Control.Carrier.Logging.Silent

Methods

alg :: forall ctx (n :: Type -> Type) a. Functor ctx => Handler ctx n (SilentLoggingC m) -> (Logging :+: sig) n a -> ctx () -> SilentLoggingC m (ctx a) #

loggerLog :: forall msg sig m. (Has Logging sig m, ToLogStr msg) => Loc -> LogLevel -> msg -> m () Source #

logs with a location Loc, level LogLevel and message msg

logging with TH

logTH :: LogLevel -> Q Exp Source #

takes a LogLevel and returns a splice that, if spliced in, returns a function that takes a Text and returns Has Logging sig m => m ()

logDebug :: Q Exp Source #

log with loglevel LevelDebug

logInfo :: Q Exp Source #

log with loglevel LevelInfo

logWarn :: Q Exp Source #

log with loglevel LevelWarn

logError :: Q Exp Source #

log with loglevel LevelError