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

Write good readme and maybe even tutorial #21

Closed chshersh closed 6 years ago

chshersh commented 7 years ago

Current README doesn't explains how to use log-warper which is bad. This README should be written. Too much effort was put into log-warper. So we must try to make this library more production-ready.

chshersh commented 6 years ago

Now we have HowTo.md with example of how to configure logging system and replace your putStrLn with logInfo. But this is not the whole tutorial. Here I will outline remaining parts:

Plan

In this message I will describe in more details what should be covered in above sections. This list might not be complete though...

Features

log-warper provides next features:

  1. Colored logging output.
  2. Hierarchical logger names.
  3. Different severity levels of messages with the ability to configure Set of severities.
  4. All* (well, almost) configuration can be described in .yaml file.
  5. Pure logging.
  6. Flexible and easy creation of LoggerConfig using monoidal builders and lenses.
  7. In-Memory logging with the ability to acquire last N megabytes of logs from in-memory cache.
  8. Monadic interface for logging.
  9. Logger rotation.

FAQ

  1. How can I redirect all output to stderr?
  2. How can I disable only Error messages for my logger?
  3. How can I show ThreadId inside log message?
  4. How to easily disable terminal output?
  5. How can I enable messages with severity Info and higher?
  6. How can I log inside functions like forkIO?
  7. How can I easily log exceptions without throwing them?
  8. How should I configure logging: through code or through .yaml file?