Development Team/Code guidelines: Difference between revisions
| Line 41: | Line 41: | ||
== Miscellaneous == | == Miscellaneous == | ||
* Use logging.debug('foo %r bar', x) instead of logging.debug('foo %r bar' % x). This is more robust and formatting only happens if we actually log something. | * Use logging.debug('foo %r bar', x) instead of logging.debug('foo %r bar' % x). This is more robust and formatting only happens if we actually log something. | ||
* When you catch an exception and want to log it, use | * When you catch an exception and want to log it, use logging.exception(), this will print the whole backtrace and exception information which is very useful when debugging. | ||
== Tools == | == Tools == | ||