From 89cb413cc1fe1495665acc090f286ec42bcaa5bb Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Thu, 29 Sep 2016 22:58:54 +0800 Subject: utils/logging: reset handlers before initialization/reconfiguration Also improve the comments. --- fg21sim/configs/manager.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'fg21sim/configs/manager.py') diff --git a/fg21sim/configs/manager.py b/fg21sim/configs/manager.py index f5465a9..a889259 100644 --- a/fg21sim/configs/manager.py +++ b/fg21sim/configs/manager.py @@ -84,7 +84,13 @@ class ConfigManager: @property def logging(self): """Get and prepare the logging configurations for - `logging.basicConfig()` + ``logging.basicConfig()`` to initialize the logging module. + + NOTE + ---- + ``basicConfig()`` will automatically create a ``Formatter`` with + the giving ``format`` and ``datefmt`` for each handlers if necessary, + and then adding the handlers to the "root" logger. """ from logging import FileHandler, StreamHandler conf = self.get("logging") -- cgit v1.2.2