Skip to content

Commit 256c839

Browse files
committed
log warnings module
1 parent 20d451f commit 256c839

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

cloudbot/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import sys
2+
import warnings
23

34
# check python version
45
if sys.version_info < (3, 4, 0):
@@ -29,6 +30,8 @@ def _setup():
2930
if not os.path.exists(logging_dir):
3031
os.makedirs(logging_dir)
3132

33+
logging.captureWarnings(True)
34+
3235
dict_config = {
3336
"version": 1,
3437
"formatters": {
@@ -66,6 +69,10 @@ def _setup():
6669
"asyncio": {
6770
"level": "DEBUG",
6871
"handlers": ["console", "file"]
72+
},
73+
"py.warnings": {
74+
"level": "DEBUG",
75+
"handlers": ["console", "file"]
6976
}
7077
}
7178
}

0 commit comments

Comments
 (0)