import logging
import os
import platform
+import re
import subprocess
import sys
from logging import Formatter
subprocess.check_call(cmd)
def logger_init(
- log_name = __file__,
- log_format = '%(asctime)s %(name)s[%(process)d] %(levelname)s: %(message)s',
+ log_name = None,
+ log_format = '%(asctime)s %(name)s [%(process)d] %(levelname)s: %(message)s',
log_level = None,
):
+ if log_name == None:
+ log_name = re.match('^(.*/jenkins_build_script/)(.*)',__name__).groups()[1]
+
if log_level == None:
try:
if ENV['GIT_BRANCH'] == 'master':