rio-0.0.0.0: A standard library for Haskell

Safe HaskellNone
LanguageHaskell2010

RIO.Logger

Synopsis

Documentation

type LogStr = DisplayBuilder Source #

class HasLogFunc env where Source #

Minimal complete definition

logFuncL

logOther Source #

Arguments

:: (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 #