Rename debug level instances

This commit is contained in:
René Stadler 2007-11-16 12:53:02 +02:00 committed by Stefan Sauer
parent 95476926f8
commit 0a483e4931
2 changed files with 13 additions and 11 deletions

View file

@ -92,12 +92,12 @@ class DebugLevel (int):
return DebugLevel (self - 1)
DebugLevelNone = DebugLevel ("NONE")
DebugLevelError = DebugLevel ("ERROR")
DebugLevelWarning = DebugLevel ("WARN")
DebugLevelInfo = DebugLevel ("INFO")
DebugLevelDebug = DebugLevel ("DEBUG")
DebugLevelLog = DebugLevel ("LOG")
debug_level_none = DebugLevel ("NONE")
debug_level_error = DebugLevel ("ERROR")
debug_level_warning = DebugLevel ("WARN")
debug_level_info = DebugLevel ("INFO")
debug_level_debug = DebugLevel ("DEBUG")
debug_level_log = DebugLevel ("LOG")
# For stripping color codes:
_escape = re.compile ("\x1b\\[[0-9;]*m")
@ -198,8 +198,9 @@ class LineCache (Producer):
level_len = 5
level_offset = ts_len + 1 + pid_len + 1 + thread_len + 1
level_end = level_offset + 1
dict_levels = {"D" : DebugLevelDebug, "L" : DebugLevelLog, "I" : DebugLevelInfo,
"E" : DebugLevelError, "W" : DebugLevelWarning, " " : DebugLevelNone}
dict_levels = {"D" : debug_level_debug, "L" : debug_level_log,
"I" : debug_level_info, "E" : debug_level_error,
"W" : debug_level_warning, " " : debug_level_none}
readline = self.__fileobj.readline
tell = self.__fileobj.tell

View file

@ -257,7 +257,7 @@ class LazyLogModel (LogModelBase):
## level = Data.DebugLevel (level_s)
match = self.__line_regex.match (regex_line[:-len (os.linesep)])
except ValueError:
level = Data.DebugLevelNone
level = Data.debug_level_none
match = None
if match is None:
@ -440,8 +440,9 @@ class LevelColumn (TextColumn):
def get_values_for_size (self):
values = [Data.DebugLevelLog, Data.DebugLevelDebug, Data.DebugLevelInfo,
Data.DebugLevelWarning, Data.DebugLevelError]
values = [Data.debug_level_log, Data.debug_level_debug,
Data.debug_level_info, Data.debug_level_warning,
Data.debug_level_error]
return values