diff options
author | Scott Moser <smoser@ubuntu.com> | 2015-09-02 16:46:11 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2015-09-02 16:46:11 -0400 |
commit | 9cd6d8a7b3f5f02e3426e7af59b36a53039dd4fb (patch) | |
tree | eae557c5542599852a93a3ab165b842783793211 /cloudinit/reporting/handlers.py | |
parent | deb6cffaa92fb5a1244c9b28f22f85bb15d46a86 (diff) | |
parent | cba8282acc1c957698480bae2d0c2032b884d80d (diff) | |
download | vyos-cloud-init-9cd6d8a7b3f5f02e3426e7af59b36a53039dd4fb.tar.gz vyos-cloud-init-9cd6d8a7b3f5f02e3426e7af59b36a53039dd4fb.zip |
sync curtin reporting changes back to cloud-init
this pulls in the reporting framework that we'd been working on
in curtin back to cloud-init.
Diffstat (limited to 'cloudinit/reporting/handlers.py')
-rw-r--r-- | cloudinit/reporting/handlers.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/cloudinit/reporting/handlers.py b/cloudinit/reporting/handlers.py index 5ed3cb84..ba480da0 100644 --- a/cloudinit/reporting/handlers.py +++ b/cloudinit/reporting/handlers.py @@ -1,7 +1,6 @@ # vi: ts=4 expandtab import abc -import oauthlib.oauth1 as oauth1 import six from ..registry import DictRegistry @@ -22,12 +21,11 @@ class ReportingHandler(object): @abc.abstractmethod def publish_event(self, event): - """Publish an event to the ``INFO`` log level.""" - print(event.as_string()) + """Publish an event.""" class LogHandler(ReportingHandler): - """Publishes events to the cloud-init log at the ``INFO`` log level.""" + """Publishes events to the cloud-init log at the ``DEBUG`` log level.""" def __init__(self, level="DEBUG"): super(LogHandler, self).__init__() @@ -43,15 +41,16 @@ class LogHandler(ReportingHandler): self.level = level def publish_event(self, event): - """Publish an event to the ``INFO`` log level.""" logger = logging.getLogger( '.'.join(['cloudinit', 'reporting', event.event_type, event.name])) logger.log(self.level, event.as_string()) class PrintHandler(ReportingHandler): + """Print the event as a string.""" + def publish_event(self, event): - """Publish an event to the ``INFO`` log level.""" + print(event.as_string()) class WebHookHandler(ReportingHandler): |