Skip to content

Commit

Permalink
Add logging example to Python coding standards
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Hammond committed Aug 26, 2013
1 parent 3b1b868 commit 13bd60c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions doc/python-coding-standards.rst
Expand Up @@ -61,6 +61,17 @@ Imports
Logging
-------

We use `the Python standard library's logging module <http://docs.python.org/2.6/library/logging.html>`_
to log messages in CKAN, e.g.::

import logging
...
logger = logging.getLogger(__name__)
...
logger.debug('some debug message')

When logging:

- Keep log messages short.

- Don't include object representations in the log message. It *is* useful
Expand Down

0 comments on commit 13bd60c

Please sign in to comment.