Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data LogLevel
- class HasLogger m where
- data Logger m :: Type
- type LogInitParams m :: Type
- type LogPayload m :: Type
- initLogger :: LogInitParams m -> forall m1. MonadIO m1 => m1 (Logger m)
- destroyLogger :: Logger m -> forall m1. MonadIO m1 => m1 ()
- logMsg :: Logger m -> LogLevel -> LogPayload m -> m ()
- logTxt :: Logger m -> LogLevel -> Text -> m ()
- class HasLogger m => MonadLogger m where
- logM :: (Monad m, MonadLogger m) => LogLevel -> Text -> m ()
- logLocM :: ExpQ
- logLoc :: ExpQ
- withLogger :: (MonadBaseControl IO m, MonadIO m, HasLogger m) => LogInitParams m -> (Logger m -> m a) -> m a
- withLoggerHoisted :: (MonadBaseControl IO m, HasLogger m) => LogInitParams m -> (Logger m -> IO a) -> IO a
Documentation
DEBUG | Debug messages |
INFO | Information |
NOTICE | Normal runtime conditions |
WARNING | General Warnings |
ERROR | General Errors |
CRITICAL | Severe situations |
ALERT | Take immediate action |
EMERGENCY | System is unusable |
Instances
Bounded LogLevel # | |
Enum LogLevel # | |
Defined in Gargantext.System.Logging | |
Show LogLevel # | |
Eq LogLevel # | |
Ord LogLevel # | |
Defined in Gargantext.System.Logging |
This is a barebore logging interface which we can extend to plug a proper logging library, without the details of the logger cropping up everywhere in the rest of the codebase.
initLogger :: LogInitParams m -> forall m1. MonadIO m1 => m1 (Logger m) #
destroyLogger :: Logger m -> forall m1. MonadIO m1 => m1 () #
logMsg :: Logger m -> LogLevel -> LogPayload m -> m () #
Instances
class HasLogger m => MonadLogger m where #
Separate typeclass to get hold of a Logger
from within a monad.
We keey HasLogger
and MonadLogger
separate to enforce compositionality,
i.e. we can still give instances to HasLogger
for things like IO
without
having to force actually acquiring a logger for those monads.
Instances
MonadLogger (GargM DevEnv BackendInternalError) # | |
Defined in Gargantext.API.Admin.EnvTypes | |
MonadLogger (GargM Env BackendInternalError) # | |
Defined in Gargantext.API.Admin.EnvTypes |
withLogger :: (MonadBaseControl IO m, MonadIO m, HasLogger m) => LogInitParams m -> (Logger m -> m a) -> m a #
withLoggerHoisted :: (MonadBaseControl IO m, HasLogger m) => LogInitParams m -> (Logger m -> IO a) -> IO a #
Like withLogger
, but it allows creating a Logger
that can run in
a different monad from within an IO
action.