sandwich-0.2.2.0: Yet another test framework for Haskell
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Sandwich.Logging

Description

Logging functions.

Synopsis

Documentation

debug :: (HasCallStack, MonadLogger m) => Text -> m () Source #

Log a message at level LevelDebug.

info :: (HasCallStack, MonadLogger m) => Text -> m () Source #

Log a message at level LevelInfo.

warn :: (HasCallStack, MonadLogger m) => Text -> m () Source #

Log a message at level LevelWarn.

logError :: (HasCallStack, MonadLogger m) => Text -> m () Source #

Log a message at level LevelError.

logOther :: (HasCallStack, MonadLogger m) => LogLevel -> Text -> m () Source #

Log with a custom LogLevel.

Process functions with logging

createProcessWithLogging :: (MonadIO m, MonadBaseControl IO m, MonadLogger m, HasCallStack) => CreateProcess -> m ProcessHandle Source #

Functions for launching processes while capturing their output in the logs.

Spawn a process with its stdout and stderr connected to the logging system. Every line output by the process will be fed to a debug call.

readCreateProcessWithLogging :: (MonadIO m, MonadBaseControl IO m, MonadLogger m, HasCallStack) => CreateProcess -> String -> m String Source #

Like readCreateProcess, but capture the stderr output in the logs. Every line output by the process will be fed to a debug call.

createProcessWithLoggingAndStdin :: (MonadIO m, MonadFail m, MonadBaseControl IO m, MonadLogger m, HasCallStack) => CreateProcess -> String -> m ProcessHandle Source #

Spawn a process with its stdout and stderr connected to the logging system. Every line output by the process will be fed to a debug call.

callCommandWithLogging :: (MonadIO m, MonadBaseControl IO m, MonadLogger m) => String -> m () Source #

Higher level version of createProcessWithLogging, accepting a shell command.

createProcessWithLogging' :: (MonadIO m, MonadBaseControl IO m, MonadLogger m, HasCallStack) => LogLevel -> CreateProcess -> m ProcessHandle Source #

Spawn a process with its stdout and stderr connected to the logging system.

createProcessWithLoggingAndStdin' :: (MonadIO m, MonadFail m, MonadBaseControl IO m, MonadLogger m, HasCallStack) => LogLevel -> CreateProcess -> String -> m ProcessHandle Source #

Spawn a process with its stdout and stderr connected to the logging system.

callCommandWithLogging' :: (MonadIO m, MonadBaseControl IO m, MonadLogger m) => LogLevel -> String -> m () Source #

Higher level version of createProcessWithLogging', accepting a shell command.