mirror of
https://github.com/mbusb/multibootusb
synced 2024-11-01 15:40:16 +00:00
Merge branch 'devel' of https://github.com/mbusb/multibootusb.git into devel
This commit is contained in:
commit
ae00ad50fb
@ -32,8 +32,6 @@ finally:
|
|||||||
RESET = ''
|
RESET = ''
|
||||||
BOLD = ''
|
BOLD = ''
|
||||||
UNDERLINE = ''
|
UNDERLINE = ''
|
||||||
finally:
|
|
||||||
config.debug and print(colors.HEADER + "=== DEBUG ENABLED ===")
|
|
||||||
|
|
||||||
def fnCall():
|
def fnCall():
|
||||||
"""
|
"""
|
||||||
|
@ -39,16 +39,20 @@ def log(message, info=True, error=False, debug=False):
|
|||||||
os.remove(LOG_FILE_PATH)
|
os.remove(LOG_FILE_PATH)
|
||||||
logging.basicConfig(filename=LOG_FILE_PATH,
|
logging.basicConfig(filename=LOG_FILE_PATH,
|
||||||
filemode='a',
|
filemode='a',
|
||||||
format='%(asctime)s,%(msecs)d %(name)s %(levelname)s %(message)s',
|
format='%(asctime)s.%(msecs)03d %(name)s %(levelname)s %(message)s',
|
||||||
datefmt='%H:%M:%S',
|
datefmt='%H:%M:%S',
|
||||||
level=logging.DEBUG)
|
level=logging.DEBUG)
|
||||||
print(message)
|
print(message)
|
||||||
|
|
||||||
|
# remove ANSI color codes from logs
|
||||||
|
message_clean = re.compile(r'\x1b[^m]*m').sub('', message)
|
||||||
|
|
||||||
if info is True:
|
if info is True:
|
||||||
logging.info(message)
|
logging.info(message_clean)
|
||||||
elif error is not False:
|
elif error is not False:
|
||||||
logging.error(message)
|
logging.error(message_clean)
|
||||||
elif debug is not False:
|
elif debug is not False:
|
||||||
logging.debug(message)
|
logging.debug(message_clean)
|
||||||
|
|
||||||
|
|
||||||
def resource_path(relativePath):
|
def resource_path(relativePath):
|
||||||
|
Loading…
Reference in New Issue
Block a user