forked from extrabacon/python-shell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstderrLogging.py
More file actions
21 lines (15 loc) · 776 Bytes
/
stderrLogging.py
File metadata and controls
21 lines (15 loc) · 776 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# logging example taken from https://docs.python.org/3/howto/logging-cookbook.html
# Note that logging logs to stderr by default
import logging
# set up logging to file - see previous section for more details
logging.basicConfig(level=logging.DEBUG)
# Now, we can log to the root logger, or any other logger. First the root...
logging.info('Jackdaws love my big sphinx of quartz.')
# Now, define a couple of other loggers which might represent areas in your
# application:
logger1 = logging.getLogger('log1')
logger2 = logging.getLogger('log2')
logger1.debug('Quick zephyrs blow, vexing daft Jim.')
logger1.info('How quickly daft jumping zebras vex.')
logger2.warning('Jail zesty vixen who grabbed pay from quack.')
logger2.error('The five boxing wizards jump quickly.')