diff --git a/README.md b/README.md index aa9e4fc..5acf50c 100644 --- a/README.md +++ b/README.md @@ -324,7 +324,7 @@ try: config = read_config(PATH) except ReadError as ex: # Can also pass `set_level` to `critical`, not just to `error`. - wryter.error('Failed to read config ({})'.format(ex), {'context': context}, set_level='debug') + wryter.error('Failed to read config ({})'.format(ex), {'context': context}, _set_level='debug') # do_something to reread the file, but this time with debug logging enabled. config_file_read = True finally: diff --git a/wryte.py b/wryte.py index 428aef3..69f542e 100644 --- a/wryte.py +++ b/wryte.py @@ -390,16 +390,16 @@ def warning(self, message, *objects, **kwargs): self.logger.warning(obj) def error(self, message, *objects, **kwargs): - if kwargs.get('set_level'): - self.set_level(kwargs.get('set_level')) - kwargs.pop('set_level') + if kwargs.get('_set_level'): + self.set_level(kwargs.get('_set_level')) + kwargs.pop('_set_level') obj = self._enrich(message, 'error', objects, kwargs) self.logger.error(obj) def critical(self, message, *objects, **kwargs): - if kwargs.get('set_level'): - self.set_level(kwargs.get('set_level')) - kwargs.pop('set_level') + if kwargs.get('_set_level'): + self.set_level(kwargs.get('_set_level')) + kwargs.pop('_set_level') obj = self._enrich(message, 'critical', objects, kwargs) self.logger.critical(obj)