From 904639a3ec6ec6ced04d220d13c97cf9fbd8f266 Mon Sep 17 00:00:00 2001 From: Yaroslav Brustinov Date: Tue, 13 Sep 2016 20:23:19 +0300 Subject: typo --- .../automation/trex_control_plane/server/CCustomLogger.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'scripts/automation/trex_control_plane/server') diff --git a/scripts/automation/trex_control_plane/server/CCustomLogger.py b/scripts/automation/trex_control_plane/server/CCustomLogger.py index fd9a32ad..551b0239 100755 --- a/scripts/automation/trex_control_plane/server/CCustomLogger.py +++ b/scripts/automation/trex_control_plane/server/CCustomLogger.py @@ -10,7 +10,8 @@ def prepare_dir(log_path): def setup_custom_logger(name, log_path = None): # first make sure path availabe - prepare_dir(log_path) + if log_path: + prepare_dir(log_path) logging.basicConfig(level = logging.INFO, format = '%(asctime)s %(name)-10s %(module)-20s %(levelname)-8s %(message)s', datefmt = '%m-%d %H:%M') @@ -30,11 +31,12 @@ def setup_custom_logger(name, log_path = None): def setup_daemon_logger (name, log_path = None): # first make sure path availabe - prepare_dir(log_path) - try: - os.unlink(log_path) - except: - pass + if log_path: + prepare_dir(log_path) + try: + os.unlink(log_path) + except: + pass logging.basicConfig(level = logging.INFO, format = '%(asctime)s %(name)-10s %(module)-20s %(levelname)-8s %(message)s', datefmt = '%m-%d %H:%M', -- cgit 1.2.3-korg