summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/server
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2016-09-13 20:23:19 +0300
committerYaroslav Brustinov <ybrustin@cisco.com>2016-09-13 20:23:19 +0300
commit904639a3ec6ec6ced04d220d13c97cf9fbd8f266 (patch)
tree6d16690e70f205b484184cdd571d8cefadf2024b /scripts/automation/trex_control_plane/server
parent148d08c1452d349e4925bc7e06806359d4296438 (diff)
typo
Diffstat (limited to 'scripts/automation/trex_control_plane/server')
-rwxr-xr-xscripts/automation/trex_control_plane/server/CCustomLogger.py14
1 files changed, 8 insertions, 6 deletions
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',