| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Shrun.Logging.Types
Contents
Description
This module provides the Log type and associated functions.
Synopsis
- data Log = MkLog {}
- newtype LogMessage = UnsafeLogMessage Text
- fromUnlined :: UnlinedText -> LogMessage
- unsafeMapLogMessage :: (Text -> Text) -> LogMessage -> LogMessage
- data LogMode
- data LogLevel
- data ConsoleLog
- data LogRegion r
- data FileLog
Basic Types
Captures the relevant information concerning a specific log (i.e. command, text, level, and mode).
Constructors
| MkLog | |
Instances
| Show Log Source # | |
| (k ~ A_Lens, a ~ Maybe CommandP1, b ~ Maybe CommandP1) => LabelOptic "cmd" k Log Log a b Source # | |
Defined in Shrun.Logging.Types | |
| (k ~ A_Lens, a ~ LogLevel, b ~ LogLevel) => LabelOptic "lvl" k Log Log a b Source # | |
Defined in Shrun.Logging.Types | |
| (k ~ A_Lens, a ~ LogMode, b ~ LogMode) => LabelOptic "mode" k Log Log a b Source # | |
Defined in Shrun.Logging.Types | |
| (k ~ A_Lens, a ~ LogMessage, b ~ LogMessage) => LabelOptic "msg" k Log Log a b Source # | |
Defined in Shrun.Logging.Types | |
newtype LogMessage Source #
Constructors
| UnsafeLogMessage Text |
Instances
| IsString LogMessage Source # | |
Defined in Shrun.Logging.Types Methods fromString :: String -> LogMessage # | |
| Show LogMessage Source # | |
Defined in Shrun.Logging.Types Methods showsPrec :: Int -> LogMessage -> ShowS # show :: LogMessage -> String # showList :: [LogMessage] -> ShowS # | |
| Eq LogMessage Source # | |
Defined in Shrun.Logging.Types | |
| (k ~ A_Getter, a ~ Text, b ~ Text) => LabelOptic "unLogMessage" k LogMessage LogMessage a b Source # | |
Defined in Shrun.Logging.Types Methods labelOptic :: Optic k NoIx LogMessage LogMessage a b Source # | |
fromUnlined :: UnlinedText -> LogMessage Source #
unsafeMapLogMessage :: (Text -> Text) -> LogMessage -> LogMessage Source #
Determines the logging behavior. This option only affects console logs; File logs are unaffected.
Constructors
| LogModeSet | Sets the logging region to this log. |
| LogModeAppend | Appends the log to the logging region. |
| LogModeFinish | Closes the logging region, finishing with the log. |
Instances
| Bounded LogMode Source # | |
| Enum LogMode Source # | |
| Show LogMode Source # | |
| Eq LogMode Source # | |
Determines the logging level.
Constructors
| LevelDebug | |
| LevelCommand | |
| LevelFinished | |
| LevelTimer | |
| LevelSuccess | |
| LevelWarn | |
| LevelError | |
| LevelFatal | |
| LevelKilled |
Instances
| Bounded LogLevel Source # | |
| Enum LogLevel Source # | |
Defined in Shrun.Logging.Types | |
| Show LogLevel Source # | |
| Eq LogLevel Source # | |
Console Logs
data ConsoleLog Source #
ConsoleLog is a textual representation of a given log after it has
been formatted.
Instances
| Show ConsoleLog Source # | |
Defined in Shrun.Logging.Types.Internal Methods showsPrec :: Int -> ConsoleLog -> ShowS # show :: ConsoleLog -> String # showList :: [ConsoleLog] -> ShowS # | |
| Eq ConsoleLog Source # | |
Defined in Shrun.Logging.Types.Internal | |
| (k ~ A_Getter, a ~ Text, b ~ Text) => LabelOptic "unConsoleLog" k ConsoleLog ConsoleLog a b Source # | |
Defined in Shrun.Logging.Types.Internal Methods labelOptic :: Optic k NoIx ConsoleLog ConsoleLog a b Source # | |
ConsoleLog with possible region.
Constructors
| LogRegion LogMode r ConsoleLog | Log with region. |
| LogNoRegion ConsoleLog | Log without region. |
File Logs
FileLog is a textual representation of a given log after it has
been formatted. No coloring is included, but we include the prefix
(e.g. Warn) along with a timestamp.