diff options
author | Aaron LI <aaronly.me@outlook.com> | 2016-09-29 18:46:14 +0800 |
---|---|---|
committer | Aaron LI <aaronly.me@outlook.com> | 2016-09-29 18:49:27 +0800 |
commit | 639a09bdf5c7580da96438bb282a1ddf1c8539a8 (patch) | |
tree | 2ae315254ed8e108971edb20120f3e92b6bad479 /fg21sim/utils | |
parent | d58ce5cdf7a188eacd0992170275c8e668d57331 (diff) | |
download | fg21sim-639a09bdf5c7580da96438bb282a1ddf1c8539a8.tar.bz2 |
utils/logging.py: Hack the "filemode" arg of "basicConfig()"
"logging.basicConfig()" does NOT accept parameter "filemode" if the
corresponding paramter "filename" NOT specified.
Diffstat (limited to 'fg21sim/utils')
-rw-r--r-- | fg21sim/utils/logging.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fg21sim/utils/logging.py b/fg21sim/utils/logging.py index 2b2317f..0abf4d3 100644 --- a/fg21sim/utils/logging.py +++ b/fg21sim/utils/logging.py @@ -39,8 +39,11 @@ def setup_logging(dict_config=None, level=None, stream=None, logfile=None): filemode = "a" # if dict_config: + # XXX: + # "basicConfig()" does NOT accept paramter "filemode" if the + # corresponding parameter "filename" NOT specified. + filemode = dict_config.pop("filemode", filemode) logging.basicConfig(**dict_config) - filemode = dict_config["filemode"] # root_logger = logging.getLogger() # |