summaryrefslogtreecommitdiff
path: root/python/logging.py
blob: 84e21345312aa2b83ebdeb75f06ed5b16cf435b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/env python3.9

import logging
import sys

logging.basicConfig(stream=sys.stdout)
logger = logging.getLogger()
logger.warning("test")
try:
    a = []
    a[1] = 2
except Exception as e:
    logger.exception(e)