diff --git a/src/corelibs/logging_handling/log.py b/src/corelibs/logging_handling/log.py index 81954f7..19f95c4 100644 --- a/src/corelibs/logging_handling/log.py +++ b/src/corelibs/logging_handling/log.py @@ -324,7 +324,8 @@ class Log: """ self.logger.log(Log.EXCEPTION, msg, *args, exc_info=True, extra=extra) - def validate_log_level(self, log_level: Any) -> bool: + @staticmethod + def validate_log_level(log_level: Any) -> bool: """ if the log level is invalid, will erturn false diff --git a/test-run/logging_handling/log.py b/test-run/logging_handling/log.py index 60585fd..e3e1708 100644 --- a/test-run/logging_handling/log.py +++ b/test-run/logging_handling/log.py @@ -30,6 +30,11 @@ def main(): log.logger.critical('[NORMAL] Critical test: %s', log.logger.name) log.exception('[NORMAL] Exception test: %s', log.logger.name) + if not Log.validate_log_level('WRONG'): + print("Invalid level") + if Log.validate_log_level('WARNING'): + print("Valid level") + if __name__ == "__main__": main()