| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Shrun.Configuration.Data.Truncation
Contents
Synopsis
- data TruncRegion
- newtype Truncation (a :: TruncRegion) = MkTruncation {
- unTruncation :: Int
- parseTruncation :: forall m (r :: TruncRegion). MonadFail m => m Natural -> m (Truncation r)
- data LineTruncation
- parseLineTruncation :: (Alternative m, MonadFail m) => m Natural -> m Text -> m LineTruncation
- decodeCommandNameTrunc :: Decoder (Maybe (WithDisabled (Truncation 'TruncCommandName)))
- decodeLineTrunc :: Decoder (Maybe (WithDisabled LineTruncation))
- data DetectResult
- mergeLineTrunc :: (HasCallStack, MonadCatch m, MonadIORef m, MonadTerminal m) => Bool -> IORef DetectResult -> Maybe (WithDisabled LineTruncation) -> Maybe (WithDisabled LineTruncation) -> m (Maybe (Truncation 'TruncLine))
- lineTruncMeta :: IsString a => (Bool, [a])
Documentation
data TruncRegion Source #
The different regions to apply truncation rules.
Constructors
| TruncCommandName | Apply truncation rules to commands/key names. |
| TruncLine | Apply truncation rules to command log entire lines. |
Instances
| Show TruncRegion Source # | |
Defined in Shrun.Configuration.Data.Truncation Methods showsPrec :: Int -> TruncRegion -> ShowS # show :: TruncRegion -> String # showList :: [TruncRegion] -> ShowS # | |
| Eq TruncRegion Source # | |
Defined in Shrun.Configuration.Data.Truncation | |
newtype Truncation (a :: TruncRegion) Source #
The maximum number of command characters to display in the logs.
Constructors
| MkTruncation | |
Fields
| |
Instances
parseTruncation :: forall m (r :: TruncRegion). MonadFail m => m Natural -> m (Truncation r) Source #
data LineTruncation Source #
Determines command log line truncation behavior. We need a separate
type from Truncation to add a third option, to detect the terminal size
automatically.
Constructors
| Undetected (Truncation 'TruncLine) | |
| Detected |
Instances
| Show LineTruncation Source # | |
Defined in Shrun.Configuration.Data.Truncation Methods showsPrec :: Int -> LineTruncation -> ShowS # show :: LineTruncation -> String # showList :: [LineTruncation] -> ShowS # | |
| Eq LineTruncation Source # | |
Defined in Shrun.Configuration.Data.Truncation Methods (==) :: LineTruncation -> LineTruncation -> Bool # (/=) :: LineTruncation -> LineTruncation -> Bool # | |
| DecodeTOML LineTruncation Source # | |
Defined in Shrun.Configuration.Data.Truncation Methods | |
parseLineTruncation :: (Alternative m, MonadFail m) => m Natural -> m Text -> m LineTruncation Source #
Misc
data DetectResult Source #
Terminal width detect result. We save this so we only look it up at most once (i.e. both --console-log-line-trunc and --file-log-line-trunc are on).
Constructors
| DetectNotRun | |
| DetectFailed | |
| DetectSucceeded Int |
Arguments
| :: (HasCallStack, MonadCatch m, MonadIORef m, MonadTerminal m) | |
| => Bool | If true, defaults to |
| -> IORef DetectResult | Detect result cache, so we only look it up at most once. |
| -> Maybe (WithDisabled LineTruncation) | Args config. |
| -> Maybe (WithDisabled LineTruncation) | Toml config. |
| -> m (Maybe (Truncation 'TruncLine)) |
Merges line truncation.
lineTruncMeta :: IsString a => (Bool, [a]) Source #