level warning from AMQP handler
Opened this issue · 1 comments
We have a hard-coded warning print statement in the amqp handler:
https://github.com/project8/dragonfly/blob/develop/dragonfly/status_log_handlers/amqp_handler.py#L48
Which results in seeing this message for every dragonfly command. We should probably remind ourselves what the desired behavior is, remove this warning, and make an issue to get the desired behavior. Or if it's easy just do it all at once.
a little more detail on when/why this occurs:
- when the amqp handler is created (https://github.com/project8/dragonfly/blob/develop/bin/dragonfly#L106), it's level is set to warning
- when the loggers are configured, the level of each handler is set (https://github.com/project8/dragonfly/blob/develop/bin/dragonfly#L249), this would overwrite the default level
- AMQP is special, it won't allow a more verbose level, lower levels being ore verbose (https://github.com/project8/dragonfly/blob/develop/bin/dragonfly#L249), it then throws the print warning
To achieve a warning-less version matching our current implementation:
- replace line 25 of AMQPHandler with
super(AMQPHandler, self).setLevel(logging.WARNING)
- replace the entire setLevel method with a dummy method to do nothing, so that bin/dragonfly doesn't overwrite the setting
Future improvement - we have an outstanding issue to disable these slack broadcasts when running interactively (see #110), which can be done by changing the log level of the AMQP handler or disabling it. We should not do conflicting things in resolving these two issues.