Skip to content

Commit

Permalink
[#3020] Tweak logging standards
Browse files Browse the repository at this point in the history
Link to the Python docs not a blog that paraphrases them, and no need to
copy-paste the log levels table into our docs.
  • Loading branch information
Sean Hammond committed Nov 16, 2012
1 parent dfdb515 commit 22441be
Showing 1 changed file with 9 additions and 30 deletions.
39 changes: 9 additions & 30 deletions doc/coding-standards.rst
Expand Up @@ -168,36 +168,15 @@ Imports
Logging
-------

- Keep messages short.

- Don't include object representations in the log message. It **is** useful
to include an domain model identifier where appropriate.

- Choose an appropriate log-level:

+----------+--------------------------------------------------------------+
| Level | Description |
+==========+==============================================================+
| DEBUG | Detailed information, of no interest when everything is |
| | working well but invaluable when diagnosing problems. |
+----------+--------------------------------------------------------------+
| INFO | Affirmations that things are working as expected, e.g. |
| | "service has started" or "indexing run complete". Often |
| | ignored. |
+----------+--------------------------------------------------------------+
| WARNING | There may be a problem in the near future, and this gives |
| | advance warning of it. But the application is able to proceed|
| | normally. |
+----------+--------------------------------------------------------------+
| ERROR | The application has been unable to proceed as expected, due |
| | to the problem being logged. |
+----------+--------------------------------------------------------------+
| CRITICAL | This is a serious error, and some kind of application |
| | meltdown might be imminent. |
+----------+--------------------------------------------------------------+

(`Source
<http://plumberjack.blogspot.co.uk/2009/09/python-logging-101.html>`_)
- Keep log messages short.

- Don't include object representations in the log message. It *is* useful
to include a domain model identifier where appropriate.

- Choose an appropriate log-level (DEBUG, INFO, ERROR, WARNING or CRITICAL,
see `Python's Logging HOWTO`_).

.. _Python's Logging HOWTO: http://docs.python.org/2/howto/logging.html

i18n
----
Expand Down

0 comments on commit 22441be

Please sign in to comment.