Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data LogLevel
- type LogSource = Text
- type LogStr = DisplayBuilder
- type LogFunc = CallStack -> LogSource -> LogLevel -> LogStr -> IO ()
- class HasLogFunc env where
- logGeneric :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => LogSource -> LogLevel -> LogStr -> m ()
- logDebug :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => LogStr -> m ()
- logInfo :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => LogStr -> m ()
- logWarn :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => LogStr -> m ()
- logError :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => LogStr -> m ()
- logOther :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => Text -> LogStr -> m ()
- logSticky :: (MonadIO m, HasCallStack, MonadReader env m, HasLogFunc env) => LogStr -> m ()
- logStickyDone :: (MonadIO m, HasCallStack, MonadReader env m, HasLogFunc env) => LogStr -> m ()
- runNoLogging :: MonadIO m => ReaderT NoLogging m a -> m a
- data NoLogging = NoLogging
- withStickyLogger :: MonadIO m => LogOptions -> (LogFunc -> m a) -> m a
- data LogOptions = LogOptions {
- logMinLevel :: !LogLevel
- logVerboseFormat :: !Bool
- logTerminal :: !Bool
- logUseTime :: !Bool
- logUseColor :: !Bool
- logUseUnicode :: !Bool
Documentation
class HasLogFunc env where Source #
logFuncL :: SimpleGetter env LogFunc Source #
logGeneric :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => LogSource -> LogLevel -> LogStr -> m () Source #
logDebug :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => LogStr -> m () Source #
logInfo :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => LogStr -> m () Source #
logWarn :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => LogStr -> m () Source #
logError :: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) => LogStr -> m () Source #
:: (MonadIO m, MonadReader env m, HasLogFunc env, HasCallStack) | |
=> Text | level |
-> LogStr | |
-> m () |
logSticky :: (MonadIO m, HasCallStack, MonadReader env m, HasLogFunc env) => LogStr -> m () Source #
Write a "sticky" line to the terminal. Any subsequent lines will
overwrite this one, and that same line will be repeated below
again. In other words, the line sticks at the bottom of the output
forever. Running this function again will replace the sticky line
with a new sticky line. When you want to get rid of the sticky
line, run logStickyDone
.
logStickyDone :: (MonadIO m, HasCallStack, MonadReader env m, HasLogFunc env) => LogStr -> m () Source #
This will print out the given message with a newline and disable
any further stickiness of the line until a new call to logSticky
happens.
It might be better at some point to have a runSticky
function
that encompasses the logSticky->logStickyDone pairing.
withStickyLogger :: MonadIO m => LogOptions -> (LogFunc -> m a) -> m a Source #
data LogOptions Source #
LogOptions | |
|