Safe Haskell | None |
---|---|
Language | Haskell2010 |
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 stringstderr
orstdout
(case sensitive), or@{path}
to log to the file atpath
. Unrecognized values will produce and error.LOG_FORMAT
: the stringtty
orjson
. Unrecognized values will produce an error.LOG_COLOR
: the stringauto
,always
, ornever
. Other values may be recognized (e.g.yes
orno
) but should not be relied on. Unrecognized values will produce an error
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.parse
runLoggerLoggingT
logger $ -- ...