Blammo-1.1.2.1: Batteries-included Structured Logging library
Safe HaskellSafe-Inferred
LanguageHaskell2010

Blammo.Logging.LogSettings.LogLevels

Description

Backwards-compatible extension to a simple LogLevel parser/filter

Assume you are using this library/module to parse a LOG_LEVEL environment variable, which is used to filter your logs.

Running,

LOG_LEVEL=warn ./my-program

Will do what you expect: filter all logging to only those messages at-or-above warn level.

While,

LOG_LEVEL=debug ./my-program

Will enable debug logging throughout.

This is all un-surprising and this module does not change behavior in this case whatsoever. But let's say that is entirely too noisy. Because you're using Amazonka and persistent, and have correctly integrated your main logging with them, you are now getting tons of spam from their very-chatty debug logs, and its drowning out the application debug logs you were hoping to see.

Well, now can do this:

LOG_LEVEL="debug,Amazonka:info,SQL:warn" ./my-program

And suddenly your application's debug logs are standing out again, because everything from the Amazonka source is filtered to info and the SQL source is filtered to warn.

The format parsed by readLogLevels is:

[source:level, ...,]level[, source:level, ...]

Where level defines the minimum level for anything not overridden by source. If you go on to add any source:level pairs, that will change the minimum level for messages from that source.

Documentation

data LogLevels Source #

Instances

Instances details
Show LogLevels Source # 
Instance details

Defined in Blammo.Logging.LogSettings.LogLevels

Eq LogLevels Source # 
Instance details

Defined in Blammo.Logging.LogSettings.LogLevels

data LogLevel #

Instances

Instances details
Read LogLevel 
Instance details

Defined in Control.Monad.Logger

Show LogLevel 
Instance details

Defined in Control.Monad.Logger

Eq LogLevel 
Instance details

Defined in Control.Monad.Logger

Ord LogLevel 
Instance details

Defined in Control.Monad.Logger

Lift LogLevel 
Instance details

Defined in Control.Monad.Logger

Methods

lift :: Quote m => LogLevel -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => LogLevel -> Code m LogLevel #