This commit is contained in:
Miroslav 2018-01-07 16:18:58 +02:00
parent 68c32d8627
commit ce5e46b668
5 changed files with 10 additions and 5 deletions

View File

@ -24,7 +24,8 @@ class TermLog:
click.secho( click.secho(
e.msg, e.msg,
file=outfile, file=outfile,
fg=dict(error="red", warn="yellow").get(e.level), fg=dict(error="red", warn="yellow",
alert="magenta").get(e.level),
dim=(e.level == "debug"), dim=(e.level == "debug"),
err=(e.level == "error") err=(e.level == "error")
) )

View File

@ -77,7 +77,7 @@ class Master:
def add_log(self, e, level): def add_log(self, e, level):
""" """
level: debug, info, warn, error level: debug, alert, info, warn, error
""" """
self.addons.trigger("log", log.LogEntry(e, level)) self.addons.trigger("log", log.LogEntry(e, level))

View File

@ -47,7 +47,7 @@ class EventLog(urwid.ListBox, layoutwidget.LayoutWidget):
if log.log_tier(self.master.options.verbosity) < log.log_tier(entry.level): if log.log_tier(self.master.options.verbosity) < log.log_tier(entry.level):
return return
txt = "%s: %s" % (entry.level, str(entry.msg)) txt = "%s: %s" % (entry.level, str(entry.msg))
if entry.level in ("error", "warn"): if entry.level in ("error", "warn", "alert"):
e = urwid.Text((entry.level, txt)) e = urwid.Text((entry.level, txt))
else: else:
e = urwid.Text(txt) e = urwid.Text(txt)

View File

@ -88,7 +88,7 @@ class ConsoleMaster(master.Master):
def sig_add_log(self, event_store, entry: log.LogEntry): def sig_add_log(self, event_store, entry: log.LogEntry):
if log.log_tier(self.options.verbosity) < log.log_tier(entry.level): if log.log_tier(self.options.verbosity) < log.log_tier(entry.level):
return return
if entry.level in ("error", "warn"): if entry.level in ("error", "warn", "alert"):
if self.first_tick: if self.first_tick:
self.start_err = entry self.start_err = entry
else: else:

View File

@ -24,7 +24,7 @@ class Palette:
# List and Connections # List and Connections
'method', 'focus', 'method', 'focus',
'code_200', 'code_300', 'code_400', 'code_500', 'code_other', 'code_200', 'code_300', 'code_400', 'code_500', 'code_other',
'error', "warn", 'error', "warn", "alert",
'header', 'highlight', 'intercept', 'replay', 'mark', 'header', 'highlight', 'intercept', 'replay', 'mark',
# Hex view # Hex view
@ -103,6 +103,7 @@ class LowDark(Palette):
code_500 = ('light red', 'default'), code_500 = ('light red', 'default'),
code_other = ('dark red', 'default'), code_other = ('dark red', 'default'),
alert = ('light magenta', 'default'),
warn = ('brown', 'default'), warn = ('brown', 'default'),
error = ('light red', 'default'), error = ('light red', 'default'),
@ -176,6 +177,7 @@ class LowLight(Palette):
error = ('light red', 'default'), error = ('light red', 'default'),
warn = ('brown', 'default'), warn = ('brown', 'default'),
alert = ('light magenta', 'default'),
header = ('dark blue', 'default'), header = ('dark blue', 'default'),
highlight = ('black,bold', 'default'), highlight = ('black,bold', 'default'),
@ -265,6 +267,7 @@ class SolarizedLight(LowLight):
error = (sol_red, 'default'), error = (sol_red, 'default'),
warn = (sol_orange, 'default'), warn = (sol_orange, 'default'),
alert = (sol_magenta, 'default'),
header = (sol_blue, 'default'), header = (sol_blue, 'default'),
highlight = (sol_base01, 'default'), highlight = (sol_base01, 'default'),
@ -319,6 +322,7 @@ class SolarizedDark(LowDark):
error = (sol_red, 'default'), error = (sol_red, 'default'),
warn = (sol_orange, 'default'), warn = (sol_orange, 'default'),
alert = (sol_magenta, 'default'),
header = (sol_blue, 'default'), header = (sol_blue, 'default'),
highlight = (sol_base01, 'default'), highlight = (sol_base01, 'default'),