summaryrefslogtreecommitdiff
path: root/giscanner/message.py
diff options
context:
space:
mode:
Diffstat (limited to 'giscanner/message.py')
-rw-r--r--giscanner/message.py13
1 files changed, 4 insertions, 9 deletions
diff --git a/giscanner/message.py b/giscanner/message.py
index 5e26592d..c59d133f 100644
--- a/giscanner/message.py
+++ b/giscanner/message.py
@@ -95,9 +95,8 @@ class MessageLogger(object):
self._cwd = os.getcwd()
self._output = output
self._namespace = namespace
- self._enable_warnings = []
+ self._enable_warnings = False
self._warning_count = 0
- self._error_count = 0
@classmethod
def get(cls, *args, **kwargs):
@@ -105,15 +104,12 @@ class MessageLogger(object):
cls._instance = cls(*args, **kwargs)
return cls._instance
- def enable_warnings(self, log_types):
- self._enable_warnings = log_types
+ def enable_warnings(self, value):
+ self._enable_warnings = bool(value)
def get_warning_count(self):
return self._warning_count
- def get_error_count(self):
- return self._error_count
-
def log(self, log_type, text, positions=None, prefix=None, marker_pos=None, marker_line=None):
"""
Log a warning, using optional file positioning information.
@@ -123,7 +119,7 @@ class MessageLogger(object):
self._warning_count += 1
- if log_type not in self._enable_warnings:
+ if not self._enable_warnings:
return
if type(positions) == set:
@@ -142,7 +138,6 @@ class MessageLogger(object):
error_type = "Warning"
elif log_type == ERROR:
error_type = "Error"
- self._error_count += 1
elif log_type == FATAL:
error_type = "Fatal"