Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Logger
- class HasLogger env where
- newLogger :: MonadIO m => LogSettings -> m Logger
- getLoggerReformat :: Logger -> LogLevel -> ByteString -> ByteString
- getLoggerShouldLog :: Logger -> LogSource -> LogLevel -> Bool
- pushLogStrLn :: MonadIO m => Logger -> LogStr -> m ()
- flushLogStr :: MonadIO m => Logger -> m ()
- newTestLogger :: MonadIO m => LogSettings -> m Logger
- data LoggedMessage = LoggedMessage {}
- getLoggedMessages :: (MonadIO m, MonadReader env m, HasLogger env) => m [Either String LoggedMessage]
- getLoggedMessagesLenient :: (MonadIO m, MonadReader env m, HasLogger env) => m [LoggedMessage]
- getLoggedMessagesUnsafe :: (HasCallStack, MonadIO m, MonadReader env m, HasLogger env) => m [LoggedMessage]
- getLoggerLoggerSet :: Logger -> LoggerSet
Documentation
getLoggerReformat :: Logger -> LogLevel -> ByteString -> ByteString Source #
flushLogStr :: MonadIO m => Logger -> m () Source #
Testing
newTestLogger :: MonadIO m => LogSettings -> m Logger Source #
Create a Logger
that will capture log messages instead of logging them
See Blammo.Logging.LoggedMessages for more details.
data LoggedMessage #
This type is the Haskell representation of each JSON log message produced by this library.
While we never interact with this type directly when logging messages with
monad-logger-aeson
, we may wish to use this type if we are
parsing/processing log files generated by this library.
Since: monad-logger-aeson-0.1.0.0
Instances
getLoggedMessages :: (MonadIO m, MonadReader env m, HasLogger env) => m [Either String LoggedMessage] Source #
Return the logged messages if newTestLogger
was used
If not, the empty list is returned.
getLoggedMessagesLenient :: (MonadIO m, MonadReader env m, HasLogger env) => m [LoggedMessage] Source #
getLoggedMessages
but ignore any messages that fail to parse
getLoggedMessagesUnsafe :: (HasCallStack, MonadIO m, MonadReader env m, HasLogger env) => m [LoggedMessage] Source #
getLoggedMessages
but throwString
if any messages failed to parse
Deprecated
getLoggerLoggerSet :: Logger -> LoggerSet Source #
Deprecated: Internal function, will be removed in a future version