Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Config = Config {
- mode :: DeployMode
- verbose :: Verbose
- logOptions :: LogOptions
- logFunc :: LogFunc
- data DeployMode
- = Development
- | Production
- | Staging
- | Test
- newtype Verbose = Verbose {}
- defaultVerbosity :: DeployMode -> Verbose -> Bool
- logDebug :: HasConfig env Config => Utf8Builder -> RIO env ()
- logInfo :: HasConfig env Config => Utf8Builder -> RIO env ()
- logWarn :: HasConfig env Config => Utf8Builder -> RIO env ()
- logError :: HasConfig env Config => Utf8Builder -> RIO env ()
- logOther :: HasConfig env Config => Text -> Utf8Builder -> RIO env ()
- logSticky :: HasConfig env Config => Utf8Builder -> RIO env ()
- logStickyDone :: HasConfig env Config => Utf8Builder -> RIO env ()
- logDebugS :: HasConfig env Config => LogSource -> Utf8Builder -> RIO env ()
- logInfoS :: HasConfig env Config => LogSource -> Utf8Builder -> RIO env ()
- logWarnS :: HasConfig env Config => LogSource -> Utf8Builder -> RIO env ()
- logErrorS :: HasConfig env Config => LogSource -> Utf8Builder -> RIO env ()
- logOtherS :: HasConfig env Config => Text -> LogSource -> Utf8Builder -> RIO env ()
- logGeneric :: HasConfig env Config => LogSource -> LogLevel -> Utf8Builder -> RIO env ()
- data LogLevel
- type LogSource = Text
Documentation
Config | |
|
data DeployMode Source #
Instances
defaultVerbosity :: DeployMode -> Verbose -> Bool Source #
Default setting for verbosity.
Standard logging functions
logDebug :: HasConfig env Config => Utf8Builder -> RIO env () Source #
Log a debug level message with no source.
logInfo :: HasConfig env Config => Utf8Builder -> RIO env () Source #
Log an info level message with no source.
logWarn :: HasConfig env Config => Utf8Builder -> RIO env () Source #
Log a warn level message with no source.
logError :: HasConfig env Config => Utf8Builder -> RIO env () Source #
Log an error level message with no source.
:: HasConfig env Config | |
=> Text | level |
-> Utf8Builder | |
-> RIO env () |
Log a message with the specified textual level and no source.
Advanced logging functions
Sticky logging
logSticky :: HasConfig env Config => Utf8Builder -> RIO env () 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
.
Note that not all LogFunc
implementations will support sticky
messages as described. However, the withLogFunc
implementation
provided by this module does.
logStickyDone :: HasConfig env Config => Utf8Builder -> RIO env () 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.
With source
logDebugS :: HasConfig env Config => LogSource -> Utf8Builder -> RIO env () Source #
Log a debug level message with the given source.
logInfoS :: HasConfig env Config => LogSource -> Utf8Builder -> RIO env () Source #
Log an info level message with the given source.
logWarnS :: HasConfig env Config => LogSource -> Utf8Builder -> RIO env () Source #
Log a warn level message with the given source.
logErrorS :: HasConfig env Config => LogSource -> Utf8Builder -> RIO env () Source #
Log an error level message with the given source.
Log a message with the specified textual level and the given source.
Generic log function
logGeneric :: HasConfig env Config => LogSource -> LogLevel -> Utf8Builder -> RIO env () Source #
Generic, basic function for creating other logging functions.