Cabal-3.7.0.0: A framework for packaging Haskell software
CopyrightIan Lynagh 2007
LicenseBSD3
Maintainercabal-devel@haskell.org
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Distribution.Verbosity

Description

A Verbosity type with associated utilities.

There are 4 standard verbosity levels from silent, normal, verbose up to deafening. This is used for deciding what logging messages to print.

Verbosity also is equipped with some internal settings which can be used to control at a fine granularity the verbosity of specific settings (e.g., so that you can trace only particular things you are interested in.) It's important to note that the instances for Verbosity assume that this does not exist.

Synopsis

Verbosity

data Verbosity Source #

Instances

Instances details
Parsec Verbosity Source #

Parser verbosity

>>> explicitEitherParsec parsecVerbosity "normal"
Right (Verbosity {vLevel = Normal, vFlags = fromList [], vQuiet = False})
>>> explicitEitherParsec parsecVerbosity "normal+nowrap  "
Right (Verbosity {vLevel = Normal, vFlags = fromList [VNoWrap], vQuiet = False})
>>> explicitEitherParsec parsecVerbosity "normal+nowrap +markoutput"
Right (Verbosity {vLevel = Normal, vFlags = fromList [VNoWrap,VMarkOutput], vQuiet = False})
>>> explicitEitherParsec parsecVerbosity "normal +nowrap +markoutput"
Right (Verbosity {vLevel = Normal, vFlags = fromList [VNoWrap,VMarkOutput], vQuiet = False})
>>> explicitEitherParsec parsecVerbosity "normal+nowrap+markoutput"
Right (Verbosity {vLevel = Normal, vFlags = fromList [VNoWrap,VMarkOutput], vQuiet = False})
>>> explicitEitherParsec parsecVerbosity "deafening+nowrap+stdout+stderr+callsite+callstack"
Right (Verbosity {vLevel = Deafening, vFlags = fromList [VCallStack,VCallSite,VNoWrap,VStderr], vQuiet = False})

Note: this parser will eat trailing spaces.

Instance details

Defined in Distribution.Verbosity

Pretty Verbosity Source # 
Instance details

Defined in Distribution.Verbosity

Structured Verbosity Source # 
Instance details

Defined in Distribution.Verbosity

Bounded Verbosity Source # 
Instance details

Defined in Distribution.Verbosity

Enum Verbosity Source # 
Instance details

Defined in Distribution.Verbosity

Generic Verbosity Source # 
Instance details

Defined in Distribution.Verbosity

Associated Types

type Rep Verbosity :: Type -> Type Source #

Read Verbosity Source # 
Instance details

Defined in Distribution.Verbosity

Show Verbosity Source # 
Instance details

Defined in Distribution.Verbosity

Binary Verbosity Source # 
Instance details

Defined in Distribution.Verbosity

Eq Verbosity Source # 
Instance details

Defined in Distribution.Verbosity

Ord Verbosity Source # 
Instance details

Defined in Distribution.Verbosity

type Rep Verbosity Source # 
Instance details

Defined in Distribution.Verbosity

isVerboseQuiet :: Verbosity -> Bool Source #

Test if we had called lessVerbose on the verbosity

verboseNoFlags :: Verbosity -> Verbosity Source #

Turn off all flags

modifyVerbosity :: (Verbosity -> Verbosity) -> Verbosity -> Verbosity Source #

Combinator for transforming verbosity level while retaining the original hidden state.

For instance, the following property holds

isVerboseNoWrap (modifyVerbosity (max verbose) v) == isVerboseNoWrap v

Note: you can use modifyVerbosity (const v1) v0 to overwrite v1's flags with v0's flags.

Since: Cabal-2.0.1.0

Call stacks

verboseCallSite :: Verbosity -> Verbosity Source #

Turn on verbose call-site printing when we log.

verboseCallStack :: Verbosity -> Verbosity Source #

Turn on verbose call-stack printing when we log.

isVerboseCallSite :: Verbosity -> Bool Source #

Test if we should output call sites when we log.

isVerboseCallStack :: Verbosity -> Bool Source #

Test if we should output call stacks when we log.

Output markets

verboseMarkOutput :: Verbosity -> Verbosity Source #

Turn on -----BEGIN CABAL OUTPUT----- markers for output from Cabal (as opposed to GHC, or system dependent).

isVerboseMarkOutput :: Verbosity -> Bool Source #

Test if we should output markets.

verboseUnmarkOutput :: Verbosity -> Verbosity Source #

Turn off marking; useful for suppressing nondeterministic output.

line-wrapping

verboseNoWrap :: Verbosity -> Verbosity Source #

Disable line-wrapping for log messages.

isVerboseNoWrap :: Verbosity -> Bool Source #

Test if line-wrapping is disabled for log messages.

timestamps

verboseTimestamp :: Verbosity -> Verbosity Source #

Turn on timestamps for log messages.

isVerboseTimestamp :: Verbosity -> Bool Source #

Test if we should output timestamps when we log.

verboseNoTimestamp :: Verbosity -> Verbosity Source #

Turn off timestamps for log messages.

Stderr

verboseStderr :: Verbosity -> Verbosity Source #

Turn on timestamps for log messages.

Since: Cabal-3.4.0.0

isVerboseStderr :: Verbosity -> Bool Source #

Test if we should output to stderr when we log.

Since: Cabal-3.4.0.0

verboseNoStderr :: Verbosity -> Verbosity Source #

Turn off timestamps for log messages.

Since: Cabal-3.4.0.0

No warnings

verboseNoWarn :: Verbosity -> Verbosity Source #

Turn off warnings for log messages

isVerboseNoWarn :: Verbosity -> Bool Source #

Test if we should output warnings when we log.