Cabal
CopyrightIan Lynagh 2007
LicenseBSD3
Maintainercabal-devel@haskell.org
Portabilityportable
Safe HaskellNone
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

Rich verbosity

data Verbosity Source #

Rich verbosity, used for the Cabal library interface.

Instances

Instances details
Structured Verbosity Source # 
Instance details

Defined in Distribution.Verbosity

NFData Verbosity Source # 
Instance details

Defined in Distribution.Verbosity

Methods

rnf :: Verbosity -> () #

Generic Verbosity Source # 
Instance details

Defined in Distribution.Verbosity

Associated Types

type Rep Verbosity 
Instance details

Defined in Distribution.Verbosity

type Rep Verbosity = D1 ('MetaData "Verbosity" "Distribution.Verbosity" "Cabal-3.18.1.0-inplace" 'False) (C1 ('MetaCons "Verbosity" 'PrefixI 'True) (S1 ('MetaSel ('Just "verbosityFlags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 VerbosityFlags) :*: S1 ('MetaSel ('Just "verbosityHandles") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 VerbosityHandles)))
type Rep Verbosity Source # 
Instance details

Defined in Distribution.Verbosity

type Rep Verbosity = D1 ('MetaData "Verbosity" "Distribution.Verbosity" "Cabal-3.18.1.0-inplace" 'False) (C1 ('MetaCons "Verbosity" 'PrefixI 'True) (S1 ('MetaSel ('Just "verbosityFlags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 VerbosityFlags) :*: S1 ('MetaSel ('Just "verbosityHandles") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 VerbosityHandles)))

data VerbosityHandles Source #

Handles to use for logging (e.g. log to stdout, or log to a file).

Instances

Instances details
Structured VerbosityHandles Source # 
Instance details

Defined in Distribution.Verbosity

NFData VerbosityHandles Source # 
Instance details

Defined in Distribution.Verbosity

Methods

rnf :: VerbosityHandles -> () #

data VerbosityLevel Source #

Constructors

Silent 
Normal 
Verbose 
Deafening 

Instances

Instances details
Structured VerbosityLevel Source # 
Instance details

Defined in Distribution.Verbosity.Internal

Binary VerbosityLevel Source # 
Instance details

Defined in Distribution.Verbosity.Internal

NFData VerbosityLevel Source # 
Instance details

Defined in Distribution.Verbosity.Internal

Methods

rnf :: VerbosityLevel -> () #

Bounded VerbosityLevel Source # 
Instance details

Defined in Distribution.Verbosity.Internal

Enum VerbosityLevel Source # 
Instance details

Defined in Distribution.Verbosity.Internal

Generic VerbosityLevel Source # 
Instance details

Defined in Distribution.Verbosity.Internal

Associated Types

type Rep VerbosityLevel 
Instance details

Defined in Distribution.Verbosity.Internal

type Rep VerbosityLevel = D1 ('MetaData "VerbosityLevel" "Distribution.Verbosity.Internal" "Cabal-3.18.1.0-inplace" 'False) ((C1 ('MetaCons "Silent" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Normal" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Verbose" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Deafening" 'PrefixI 'False) (U1 :: Type -> Type)))
Read VerbosityLevel Source # 
Instance details

Defined in Distribution.Verbosity.Internal

Show VerbosityLevel Source # 
Instance details

Defined in Distribution.Verbosity.Internal

Eq VerbosityLevel Source # 
Instance details

Defined in Distribution.Verbosity.Internal

Ord VerbosityLevel Source # 
Instance details

Defined in Distribution.Verbosity.Internal

type Rep VerbosityLevel Source # 
Instance details

Defined in Distribution.Verbosity.Internal

type Rep VerbosityLevel = D1 ('MetaData "VerbosityLevel" "Distribution.Verbosity.Internal" "Cabal-3.18.1.0-inplace" 'False) ((C1 ('MetaCons "Silent" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Normal" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Verbose" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Deafening" 'PrefixI 'False) (U1 :: Type -> Type)))

verbosityChosenOutputHandle :: Verbosity -> Handle Source #

The handle used for normal output.

With the +stderr verbosity flag, this is the error handle.

verbosityErrorHandle :: Verbosity -> Handle Source #

The verbosity handle used for error output.

Verbosity flags

data VerbosityFlags Source #

Verbosity information which can be passed by the CLI.

Instances

Instances details
Parsec VerbosityFlags Source #

Parser verbosity

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

Note: this parser will eat trailing spaces.

Instance details

Defined in Distribution.Verbosity

Pretty VerbosityFlags Source # 
Instance details

Defined in Distribution.Verbosity

Structured VerbosityFlags Source # 
Instance details

Defined in Distribution.Verbosity

Binary VerbosityFlags Source # 
Instance details

Defined in Distribution.Verbosity

NFData VerbosityFlags Source # 
Instance details

Defined in Distribution.Verbosity

Methods

rnf :: VerbosityFlags -> () #

Generic VerbosityFlags Source # 
Instance details

Defined in Distribution.Verbosity

Associated Types

type Rep VerbosityFlags 
Instance details

Defined in Distribution.Verbosity

type Rep VerbosityFlags = D1 ('MetaData "VerbosityFlags" "Distribution.Verbosity" "Cabal-3.18.1.0-inplace" 'False) (C1 ('MetaCons "VerbosityFlags" 'PrefixI 'True) (S1 ('MetaSel ('Just "vLevel") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 VerbosityLevel) :*: (S1 ('MetaSel ('Just "vFlags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Set VerbosityFlag)) :*: S1 ('MetaSel ('Just "vQuiet") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool))))
Read VerbosityFlags Source # 
Instance details

Defined in Distribution.Verbosity

Show VerbosityFlags Source # 
Instance details

Defined in Distribution.Verbosity

Eq VerbosityFlags Source # 
Instance details

Defined in Distribution.Verbosity

type Rep VerbosityFlags Source # 
Instance details

Defined in Distribution.Verbosity

type Rep VerbosityFlags = D1 ('MetaData "VerbosityFlags" "Distribution.Verbosity" "Cabal-3.18.1.0-inplace" 'False) (C1 ('MetaCons "VerbosityFlags" 'PrefixI 'True) (S1 ('MetaSel ('Just "vLevel") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 VerbosityLevel) :*: (S1 ('MetaSel ('Just "vFlags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Set VerbosityFlag)) :*: S1 ('MetaSel ('Just "vQuiet") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool))))

makeVerbose :: VerbosityFlags -> VerbosityFlags Source #

Make sure the verbosity level is at least verbose, but stay silent if we are.

silent :: VerbosityFlags Source #

In silent mode, we should not print anything unless an error occurs.

normal :: VerbosityFlags Source #

Print stuff we want to see by default.

verbose :: VerbosityFlags Source #

Be more verbose about what's going on.

deafening :: VerbosityFlags Source #

Not only are we verbose ourselves (perhaps even noisier than when being verbose), but we tell everything we run to be verbose too.

moreVerbose :: VerbosityFlags -> VerbosityFlags Source #

Increase verbosity level, but stay silent if we are.

lessVerbose :: VerbosityFlags -> VerbosityFlags Source #

Decrease verbosity level, but stay deafening if we are.

isVerboseQuiet :: VerbosityFlags -> Bool Source #

Test if we had called lessVerbose on the verbosity.

intToVerbosity :: Int -> Maybe VerbosityFlags Source #

Numeric verbosity level 0..3: 0 is silent, 3 is deafening.

Call stacks

verboseCallSite :: VerbosityFlags -> VerbosityFlags Source #

Turn on verbose call-site printing when we log.

verboseCallStack :: VerbosityFlags -> VerbosityFlags Source #

Turn on verbose call-stack printing when we log.

isVerboseCallSite :: VerbosityFlags -> Bool Source #

Test if we should output call sites when we log.

isVerboseCallStack :: VerbosityFlags -> Bool Source #

Test if we should output call stacks when we log.

Output markers

verboseMarkOutput :: VerbosityFlags -> VerbosityFlags Source #

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

isVerboseMarkOutput :: VerbosityFlags -> Bool Source #

Test if we should output markers.

verboseUnmarkOutput :: VerbosityFlags -> VerbosityFlags Source #

Turn off marking; useful for suppressing nondeterministic output.

Line wrapping

verboseNoWrap :: VerbosityFlags -> VerbosityFlags Source #

Disable line-wrapping for log messages.

isVerboseNoWrap :: VerbosityFlags -> Bool Source #

Test if line-wrapping is disabled for log messages.

Time stamps

verboseTimestamp :: VerbosityFlags -> VerbosityFlags Source #

Turn on timestamps for log messages.

isVerboseTimestamp :: VerbosityFlags -> Bool Source #

Test if we should output timestamps when we log.

verboseNoTimestamp :: VerbosityFlags -> VerbosityFlags Source #

Turn off timestamps for log messages.

Stderr

verboseStderr :: VerbosityFlags -> VerbosityFlags Source #

Switch logging to stderr.

Since: 3.4.0.0

isVerboseStderr :: VerbosityFlags -> Bool Source #

Test if we should output to stderr when we log.

Since: 3.4.0.0

verboseNoStderr :: VerbosityFlags -> VerbosityFlags Source #

Switch logging to stdout.

Since: 3.4.0.0

No warnings

verboseNoWarn :: VerbosityFlags -> VerbosityFlags Source #

Turn off warnings for log messages.

isVerboseNoWarn :: VerbosityFlags -> Bool Source #

Test if we should output warnings when we log.