Safe Haskell | None |
---|---|
Language | GHC2021 |
Provides logging functionality. This is a high-level picture of how logging works:
- Shrun.IO sends logs per command based on the environment (i.e. is file logging on and/or do we log commands). If any logs are produced, they are formatted and sent directly to a queue.
- Shrun also produces logs. These are "higher-level" e.g. success/failure status of a given command, fatal errors, etc. Shrun uses the functions here (e.g. putRegionLog) that handles deciding if a given log should be written to eitherboth of the consolefile log queues.
- Shrun has two threads -- one for each queue -- that poll their respective queues and writes logs as they are found. These do no environment checking; any logs that make it to the queue are eventually written.
Synopsis
- putRegionLog :: (HasCallStack, HasCommonLogging env, HasConsoleLogging env (Region m), HasFileLogging env, MonadReader env m, MonadSTM m, MonadTime m) => Region m -> Log -> m ()
- regionLogToConsoleQueue :: (HasCallStack, HasCommonLogging env, HasConsoleLogging env (Region m), MonadReader env m, MonadSTM m) => Region m -> Log -> m ()
- logToFileQueue :: (HasCallStack, MonadSTM m, MonadTime m) => KeyHideSwitch -> FileLoggingEnv -> Log -> m ()
Writing logs
:: (HasCallStack, HasCommonLogging env, HasConsoleLogging env (Region m), HasFileLogging env, MonadReader env m, MonadSTM m, MonadTime m) | |
=> Region m | Region. |
-> Log | Log to send. |
-> m () |
Unconditionally writes a log to the console queue. Conditionally
writes the log to the file queue, if Logging
's fileLogging
is
present.
regionLogToConsoleQueue Source #
:: (HasCallStack, HasCommonLogging env, HasConsoleLogging env (Region m), MonadReader env m, MonadSTM m) | |
=> Region m | Region. |
-> Log | Log to send. |
-> m () |
Writes the log to the console queue.
:: (HasCallStack, MonadSTM m, MonadTime m) | |
=> KeyHideSwitch | How to display the command. |
-> FileLoggingEnv | FileLogging config. |
-> Log | Log to send. |
-> m () |
Writes the log to the file queue.