Skip to content

Commit

Permalink
fix logger display
Browse files Browse the repository at this point in the history
  • Loading branch information
LoRexxar committed Sep 14, 2020
1 parent 7fc903d commit 1e9ae79
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion core/cast.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def block_code(self, block_position):
"""
if block_position == 2:
if self.line is None or self.line == 0:
logger.critical("[AST] Line exception: {0}".format(self.line))
logger.error("[AST] Line exception: {0}".format(self.line))
return False
line_rule = '{0}p'.format(self.line)
code = File(self.file_path).lines(line_rule)
Expand Down
2 changes: 1 addition & 1 deletion core/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def start(target, formatter, output, special_rules, a_sid=None, language=None, t
language=main_language, framework=main_framework, file_count=file_count, extension_count=len(files),
files=files, tamper_name=tamper_name, is_unconfirm=is_unconfirm)
except KeyboardInterrupt as e:
logger.critical("[!] KeyboardInterrupt, exit...")
logger.error("[!] KeyboardInterrupt, exit...")
exit()
except Exception:
result = {
Expand Down
2 changes: 1 addition & 1 deletion core/detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def language(self):
language_extensions = {}
xml_languages = self._read_xml('languages.xml')
if xml_languages is None:
logger.critical('languages read failed!!!')
logger.error('languages read failed!!!')
languages = None
for language in xml_languages:
l_name = language.get('name').lower()
Expand Down
2 changes: 1 addition & 1 deletion utils/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ def files(self, absolute_path, level=1):
self.file_info(directory, filename)
except OSError as e:
logger.error("[PICKUP] {}".format(traceback.format_exc()))
logger.critical('[PICKUP] {msg}'.format(msg=e))
logger.error('[PICKUP] {msg}'.format(msg=e))
exit()

def file_info(self, path, filename):
Expand Down
2 changes: 1 addition & 1 deletion utils/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def log(loglevel, log_name):
handler = colorlog.StreamHandler()
handler.setFormatter(
colorlog.ColoredFormatter(
fmt='%(log_color)s[%(levelname)s][%(asctime)s][%(filename)s:%(lineno)d] %(message)s',
fmt='[%(levelname)s][%(asctime)s][%(filename)s:%(lineno)d] %(message)s',
datefmt="%H:%M:%S",
log_colors={
'DEBUG': 'cyan',
Expand Down
5 changes: 1 addition & 4 deletions utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,7 @@ def secure_filename(filename):
_filename_utf8_strip_re = re.compile(u"[^\u4e00-\u9fa5A-Za-z0-9_.\-\+]")
_windows_device_files = ('CON', 'AUX', 'COM1', 'COM2', 'COM3', 'COM4', 'LPT1', 'LPT2', 'LPT3', 'PRN', 'NUL')

try:
text_type = unicode # Python 2
except NameError:
text_type = str # Python 3
text_type = str # Python 3

if isinstance(filename, text_type):
from unicodedata import normalize
Expand Down

0 comments on commit 1e9ae79

Please sign in to comment.