mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 00:01:36 +00:00
Fix #2688
This commit is contained in:
parent
68c32d8627
commit
ce5e46b668
@ -24,7 +24,8 @@ class TermLog:
|
||||
click.secho(
|
||||
e.msg,
|
||||
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"),
|
||||
err=(e.level == "error")
|
||||
)
|
||||
|
@ -77,7 +77,7 @@ class Master:
|
||||
|
||||
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))
|
||||
|
||||
|
@ -47,7 +47,7 @@ class EventLog(urwid.ListBox, layoutwidget.LayoutWidget):
|
||||
if log.log_tier(self.master.options.verbosity) < log.log_tier(entry.level):
|
||||
return
|
||||
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))
|
||||
else:
|
||||
e = urwid.Text(txt)
|
||||
|
@ -88,7 +88,7 @@ class ConsoleMaster(master.Master):
|
||||
def sig_add_log(self, event_store, entry: log.LogEntry):
|
||||
if log.log_tier(self.options.verbosity) < log.log_tier(entry.level):
|
||||
return
|
||||
if entry.level in ("error", "warn"):
|
||||
if entry.level in ("error", "warn", "alert"):
|
||||
if self.first_tick:
|
||||
self.start_err = entry
|
||||
else:
|
||||
|
@ -24,7 +24,7 @@ class Palette:
|
||||
# List and Connections
|
||||
'method', 'focus',
|
||||
'code_200', 'code_300', 'code_400', 'code_500', 'code_other',
|
||||
'error', "warn",
|
||||
'error', "warn", "alert",
|
||||
'header', 'highlight', 'intercept', 'replay', 'mark',
|
||||
|
||||
# Hex view
|
||||
@ -103,6 +103,7 @@ class LowDark(Palette):
|
||||
code_500 = ('light red', 'default'),
|
||||
code_other = ('dark red', 'default'),
|
||||
|
||||
alert = ('light magenta', 'default'),
|
||||
warn = ('brown', 'default'),
|
||||
error = ('light red', 'default'),
|
||||
|
||||
@ -176,6 +177,7 @@ class LowLight(Palette):
|
||||
|
||||
error = ('light red', 'default'),
|
||||
warn = ('brown', 'default'),
|
||||
alert = ('light magenta', 'default'),
|
||||
|
||||
header = ('dark blue', 'default'),
|
||||
highlight = ('black,bold', 'default'),
|
||||
@ -265,6 +267,7 @@ class SolarizedLight(LowLight):
|
||||
|
||||
error = (sol_red, 'default'),
|
||||
warn = (sol_orange, 'default'),
|
||||
alert = (sol_magenta, 'default'),
|
||||
|
||||
header = (sol_blue, 'default'),
|
||||
highlight = (sol_base01, 'default'),
|
||||
@ -319,6 +322,7 @@ class SolarizedDark(LowDark):
|
||||
|
||||
error = (sol_red, 'default'),
|
||||
warn = (sol_orange, 'default'),
|
||||
alert = (sol_magenta, 'default'),
|
||||
|
||||
header = (sol_blue, 'default'),
|
||||
highlight = (sol_base01, 'default'),
|
||||
|
Loading…
Reference in New Issue
Block a user