Allow disabling output from plugins
This commit is contained in:
parent
8ebd6ad200
commit
2cd54a5933
@ -8,6 +8,9 @@ class LoggingMixin():
|
|||||||
Logging Mixin
|
Logging Mixin
|
||||||
Shows similar messages only once every `refresh_period`.
|
Shows similar messages only once every `refresh_period`.
|
||||||
"""
|
"""
|
||||||
|
# Disable output completely
|
||||||
|
show_output = True
|
||||||
|
|
||||||
def __init__(self, logger, refresh_period: int = 3600):
|
def __init__(self, logger, refresh_period: int = 3600):
|
||||||
"""
|
"""
|
||||||
:param refresh_period: in seconds - Show identical messages in this intervals
|
:param refresh_period: in seconds - Show identical messages in this intervals
|
||||||
@ -31,4 +34,5 @@ class LoggingMixin():
|
|||||||
# Log as debug first
|
# Log as debug first
|
||||||
self.logger.debug(message)
|
self.logger.debug(message)
|
||||||
# Call hidden function.
|
# Call hidden function.
|
||||||
|
if self.show_output:
|
||||||
_log_once(message)
|
_log_once(message)
|
||||||
|
Loading…
Reference in New Issue
Block a user