Cabal-2.0.1.0: A framework for packaging Haskell software

Copyright | Ian Lynagh 2007
License | BSD3
Maintainer | cabal-devel@haskell.org
Portability | portable
Safe Haskell | None
Language | Haskell2010

Distribution.Verbosity

Contents

- Verbosity
- Call stacks
- Output markets
- line-wrapping

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

- data Verbosity
- silent :: Verbosity
- normal :: Verbosity
- verbose :: Verbosity
- deafening :: Verbosity
- moreVerbose :: Verbosity -> Verbosity
- lessVerbose :: Verbosity -> Verbosity
- isVerboseQuiet :: Verbosity -> Bool
- intToVerbosity :: Int -> Maybe Verbosity
- flagToVerbosity :: ReadE Verbosity
- showForCabal :: Verbosity -> String
- showForGHC :: Verbosity -> String
- verboseNoFlags :: Verbosity -> Verbosity
- verboseHasFlags :: Verbosity -> Bool
- modifyVerbosity :: (Verbosity -> Verbosity) -> Verbosity -> Verbosity
- verboseCallSite :: Verbosity -> Verbosity
- verboseCallStack :: Verbosity -> Verbosity
- isVerboseCallSite :: Verbosity -> Bool
- isVerboseCallStack :: Verbosity -> Bool
- verboseMarkOutput :: Verbosity -> Verbosity
- isVerboseMarkOutput :: Verbosity -> Bool
- verboseUnmarkOutput :: Verbosity -> Verbosity
- verboseNoWrap :: Verbosity -> Verbosity
- isVerboseNoWrap :: Verbosity -> Bool

# Verbosity

data Verbosity #

Instances

Bounded Verbosity # |
Methods minBound :: Verbosity Source # maxBound :: Verbosity Source #
Enum Verbosity # |

Methods

succ :: Verbosity -> Verbosity Source #

pred :: Verbosity -> Verbosity Source #

toEnum :: Int -> Verbosity Source #

fromEnum :: Verbosity -> Int Source #

enumFrom :: Verbosity -> [Verbosity] Source #

enumFromThen :: Verbosity -> Verbosity -> [Verbosity] Source #

enumFromTo :: Verbosity -> Verbosity -> [Verbosity] Source #

enumFromThenTo :: Verbosity -> Verbosity -> Verbosity -> [Verbosity] Source #

Eq Verbosity # |
Methods (==) :: Verbosity -> Verbosity -> Bool # (/=) :: Verbosity -> Verbosity -> Bool #
Ord Verbosity # |
Methods compare :: Verbosity -> Verbosity -> Ordering # (<) :: Verbosity -> Verbosity -> Bool # (<=) :: Verbosity -> Verbosity -> Bool # (>) :: Verbosity -> Verbosity -> Bool # (>=) :: Verbosity -> Verbosity -> Bool # max :: Verbosity -> Verbosity -> Verbosity # min :: Verbosity -> Verbosity -> Verbosity #
Read Verbosity # |
Methods readsPrec :: Int -> ReadS Verbosity Source # readList :: ReadS [Verbosity] Source # readPrec :: ReadPrec Verbosity Source # readListPrec :: ReadPrec [Verbosity] Source #
Show Verbosity # |
Methods showsPrec :: Int -> Verbosity -> ShowS Source # show :: Verbosity -> String Source # showList :: [Verbosity] -> ShowS Source #
Generic Verbosity # |
Associated Types type Rep Verbosity :: * -> * Source # Methods from :: Verbosity -> Rep Verbosity x Source # to :: Rep Verbosity x -> Verbosity Source #
Binary Verbosity # |
Methods put :: Verbosity -> Put Source # get :: Get Verbosity Source # putList :: [Verbosity] -> Put Source #
type Rep Verbosity # |
type Rep Verbosity

silent :: Verbosity #

normal :: Verbosity #

verbose :: Verbosity #

deafening :: Verbosity #

moreVerbose :: Verbosity -> Verbosity #

lessVerbose :: Verbosity -> Verbosity #

isVerboseQuiet :: Verbosity -> Bool #

Test if we had called `lessVerbose` on the verbosity

intToVerbosity :: Int -> Maybe Verbosity #

flagToVerbosity :: ReadE Verbosity #

showForCabal :: Verbosity -> String #

showForGHC :: Verbosity -> String #

verboseNoFlags :: Verbosity -> Verbosity #

verboseHasFlags :: Verbosity -> Bool #

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

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: 2.0.1

# Call stacks

verboseCallSite :: Verbosity -> Verbosity #

Turn on verbose call-site printing when we log.

verboseCallStack :: Verbosity -> Verbosity #

Turn on verbose call-stack printing when we log.

isVerboseCallSite :: Verbosity -> Bool #

Test if we should output call sites when we log.

isVerboseCallStack :: Verbosity -> Bool #

Test if we should output call stacks when we log.

# Output markets

verboseMarkOutput :: Verbosity -> Verbosity #

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

isVerboseMarkOutput :: Verbosity -> Bool #

Test if we should output markets.

verboseUnmarkOutput :: Verbosity -> Verbosity #

Turn off marking; useful for suppressing nondeterministic output.

# line-wrapping

verboseNoWrap :: Verbosity -> Verbosity #

Disable line-wrapping for log messages.

isVerboseNoWrap :: Verbosity -> Bool #

Test if line-wrapping is disabled for log messages.