summaryrefslogtreecommitdiff
path: root/cloudinit/log.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2012-11-12 09:34:34 -0500
committerScott Moser <smoser@ubuntu.com>2012-11-12 09:34:34 -0500
commit9de2f909415ad5a5ca4ad3584c73c0e643ba6079 (patch)
tree39e176f79fedf638d50d3044435021a31b93d6f7 /cloudinit/log.py
parentb0f6c7bfa94a5ba302debdc16a175cb0017f9634 (diff)
parent71ba36704132ff8597dfc0e45b34e0c4424e239f (diff)
downloadvyos-cloud-init-9de2f909415ad5a5ca4ad3584c73c0e643ba6079.tar.gz
vyos-cloud-init-9de2f909415ad5a5ca4ad3584c73c0e643ba6079.zip
merge from trunk
Diffstat (limited to 'cloudinit/log.py')
-rw-r--r--cloudinit/log.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/cloudinit/log.py b/cloudinit/log.py
index 2333e5ee..da6c2851 100644
--- a/cloudinit/log.py
+++ b/cloudinit/log.py
@@ -53,6 +53,18 @@ def setupBasicLogging():
root.setLevel(DEBUG)
+def flushLoggers(root):
+ if not root:
+ return
+ for h in root.handlers:
+ if isinstance(h, (logging.StreamHandler)):
+ try:
+ h.flush()
+ except IOError:
+ pass
+ flushLoggers(root.parent)
+
+
def setupLogging(cfg=None):
# See if the config provides any logging conf...
if not cfg: