Skip to content

Commit

Permalink
Log level can accept int and string ignore case (#2200)
Browse files Browse the repository at this point in the history
  • Loading branch information
siyuan0322 committed Nov 4, 2022
1 parent fb12c7b commit 264cbc8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions python/graphscope/client/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,20 +264,19 @@ def init():
"%(asctime)s [%(levelname)s][%(module)s:%(lineno)d]: %(message)s"
)
stdout_handler.setFormatter(formatter)
if gs_config.show_log:
stdout_handler.setLevel(gs_config.log_level.upper())
else:
stdout_handler.setLevel(logging.ERROR)
logger.addHandler(stdout_handler)
logger.propagate = False
GSLogger.update()

@staticmethod
def update():
if gs_config.show_log:
log_level = gs_config.log_level
else:
log_level = logging.ERROR
logger.setLevel(log_level.upper())
if isinstance(log_level, str):
log_level = log_level.upper()
logger.setLevel(log_level)
for handler in logger.handlers:
handler.setLevel(log_level)

Expand Down

0 comments on commit 264cbc8

Please sign in to comment.