Skip to content

Releases: laurb9/rich-traceback

Original version

14 Oct 06:54
Compare
Choose a tag to compare

Fully-functional log module using syslog.

Usage:

import log

logger = log.Log()

log.debug("message")
log.warning("message")
log.error("message")

try:
    something()
except Exception:
    log.stackTrace("uncaught exception")

Exception output example:

python log.py
tail /var/log/messages

log.py: Exception <type 'exceptions.ZeroDivisionError'>: 'integer division or modulo by zero' (2 stack frames following, innermost [0])
log.py: [0] log.py, test(y=5) at line 252: x = y / 0
log.py: [1] log.py, <module>() at line 255: test(5)