diff --git a/src/de/p1st/monitor/logger.py b/src/de/p1st/monitor/logger.py index e892d23..9bedf5f 100644 --- a/src/de/p1st/monitor/logger.py +++ b/src/de/p1st/monitor/logger.py @@ -24,9 +24,12 @@ class Logger(ABC): # Either both variables are given, or both are None if warn_if_above is not None and critical_if_above is not None: - assert critical_if_above > warn_if_above + if critical_if_above <= warn_if_above: + raise Exception(f'The critical limit is not greater that the warning limit:' + f' {critical_if_above}, {warn_if_above}') else: - assert warn_if_above is None and critical_if_above is None + if warn_if_above is not None or critical_if_above is not None: + raise Exception('Either both, warn_if_above and critical_if_above, must be given, or both must be None.') self.warn_if_above = warn_if_above self.critical_if_above = critical_if_above