serokell / log-warper

Logging library to provide more convenient, extremely configurable but simple monadic interface with pretty output
MIT License
19 stars 11 forks source link

Make log running interface simpler #61

Closed chshersh closed 6 years ago

chshersh commented 6 years ago

It would be good to have simpler interface for running logging. For example, this default running from tutorial can be done in separate function like runLoggingWithFile:

mainWithLogging :: IO ()
mainWithLogging = do
    buildAndSetupYamlLogging productionB "examples/how-to-log-config.yaml"
    usingLoggerName "new-logger" inputLengthWithLog

Another function which can be helpful is to not use config from file. Just hardcode some default reasonable config (well, this default config still can be at least a function from LoggerName to LoggerConfig and emulate one from tutorial).