From 74ee8154f22e608c3972e638cba50dd05a626cae Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Tue, 8 Dec 2015 01:45:22 +0100 Subject: [PATCH] add developer docs about output and logging --- docs/development.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/development.rst b/docs/development.rst index 753f3d554..0d75dfe4a 100644 --- a/docs/development.rst +++ b/docs/development.rst @@ -19,6 +19,18 @@ separate sections either. The `flake8 `_ commandline tool should be used to check for style errors before sending pull requests. +Output and Logging +------------------ +When writing logger calls, always use correct log level (debug only for +debugging, info for informative messages, warning for warnings, error for +errors, critical for critical errors/states). + +When directly talking to the user (e.g. Y/N questions), do not use logging, +but directly output to stderr (not: stdout, it could be connected to a pipe). + +To control the amount and kinds of messages output to stderr or emitted at +info level, use flags like --stats. + Building a development environment ----------------------------------