| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Blammo.Logging.LogSettings.Env
Description
Produce a LogSettings by reading environment variables
LOG_LEVEL: a known log level (case insensitive) and optional levels by source. See Logging.LogSettings.LogLevels.LOG_DESTINATION: the stringstderrorstdout(case sensitive), or@{path}to log to the file atpath. Unrecognized values will produce and error.LOG_FORMAT: the stringttyorjson. Unrecognized values will produce an error.LOG_COLOR: the stringauto,always, ornever. Other values may be recognized (e.g.yesorno) but should not be relied on. Unrecognized values will produce an errorLOG_BREAKPOINT: a number representing the column-width at which to break into multi-line format.LOG_CONCURRENCY: number of log buffers to use. More will perform faster but result in out-of-order delivery. This is automatically disabled forLOG_FORMAT=ttyand set to number-of-cores forLOG_FORMAT=json.NO_COLOR: if present and non-empty, behave as ifLOG_COLOR=neverTERM: if present and the valuedumb, behave as ifLOG_COLOR=never.
This module is meant to be imported qualified.
import Blammo.Logging import qualified Logging.LogSettings.Env as Env main :: IO () main = do logger <-newLogger=<< Env.parserunLoggerLoggingTlogger $ -- ...
Synopsis
Documentation
parse :: IO LogSettings Source #
Specifying defaults other than defaultLogSettings
For example, if you want logging to go to stderr by default, but still
support LOG_DESTINATION,
settings <- Env.parseWith$setLogSettingsDestinationLogDestinationStderrdefaultLogSettings
parseWith :: LogSettings -> IO LogSettings Source #