From 87fe52ea61ce693ccb6d894b22b37cff0fd0f7eb Mon Sep 17 00:00:00 2001
From: Darko Poljak <foss@ungleich.com>
Date: Sat, 12 Aug 2017 23:02:31 +0200
Subject: [PATCH] Default logging level is WARNING.

---
 cdist/emulator.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/cdist/emulator.py b/cdist/emulator.py
index 66736643..eff2f221 100644
--- a/cdist/emulator.py
+++ b/cdist/emulator.py
@@ -105,9 +105,12 @@ class Emulator(object):
         """Setup logging facility"""
 
         if '__cdist_loglevel' in self.env:
-            level = int(self.env['__cdist_loglevel'])
+            try:
+                level = int(self.env['__cdist_loglevel'])
+            except:
+                level = logging.WARNING
         else:
-            level = logging.OFF
+            level = logging.WARNING
         logging.root.setLevel(level)
 
         self.log = logging.getLogger(self.target_host[0])