Development Team/Code guidelines: Difference between revisions
No edit summary |
|||
| 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 traceback.format_exc(). | |||
== Tools == | == Tools == | ||