Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom output should account for the current verbosity level #7

Merged
merged 3 commits into from
Mar 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 6 additions & 3 deletions logbasecommand/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,18 @@ def log_debug(self, msg, *args, **kwargs):
return self.logger.debug(msg, *args, **kwargs)

def log(self, msg, *args, **kwargs):
self.__custom_stdout(msg, *args)
if self.logger.level <= logging.INFO:
gsilvapt marked this conversation as resolved.
Show resolved Hide resolved
self.__custom_stdout(msg, *args)
return self.logger.info(msg, *args, **kwargs)

def log_warning(self, msg, *args, **kwargs):
self.__custom_stderr(msg, *args)
if self.logger.level <= logging.WARNING:
self.__custom_stderr(msg, *args)
return self.logger.warning(msg, *args, **kwargs)

def log_error(self, msg, *args, **kwargs):
self.__custom_stderr(msg, *args)
if self.logger.level <= logging.ERROR:
self.__custom_stderr(msg, *args)
return self.logger.error(msg, *args, **kwargs)

def log_exception(self, msg, *args, **kwargs):
Expand Down