FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-shell/test/python/stderrLogging.py at master · X1Vi/python-shell · GitHub
X1Vi
python-shell
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python-shell
/
test
/
python
/
stderrLogging.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
21 lines (15 loc) · 776 Bytes
Breadcrumbs
python-shell
/
test
/
python
/
stderrLogging.py
Copy path
File metadata and controls
21 lines (15 loc) · 776 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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.'
)
Back
|
FazBrowse Home
|
New Git URL