optimised tui + removed: force info, force debug
This commit is contained in:
parent
044870b6e8
commit
a5b50da2c8
17
loggy.py
17
loggy.py
@ -70,8 +70,6 @@ class LogViewerApp(App):
|
||||
self.force_critical = True
|
||||
self.force_error = True
|
||||
self.force_warning = False
|
||||
self.force_info = False
|
||||
self.force_debug = False
|
||||
self.log_display = RichLog(highlight=True, markup=True)
|
||||
|
||||
def compose(self) -> ComposeResult:
|
||||
@ -82,12 +80,9 @@ class LogViewerApp(App):
|
||||
with Vertical(id="bottom-bar"):
|
||||
yield Input(placeholder="module filter...", id="module_filter")
|
||||
yield Input(placeholder="level filter...", id="level_filter")
|
||||
with Vertical(id="force-bar"):
|
||||
yield Checkbox("Force CRITICAL", self.force_critical, id="force_critical")
|
||||
yield Checkbox("Force ERROR", self.force_error, id="force_error")
|
||||
yield Checkbox("Force WARNING", self.force_warning, id="force_warning")
|
||||
yield Checkbox("Force INFO", self.force_info, id="force_info")
|
||||
yield Checkbox("Force DEBUG", self.force_debug, id="force_debug")
|
||||
yield Checkbox("CRITICAL", self.force_critical, id="force_critical")
|
||||
yield Checkbox("ERROR", self.force_error, id="force_error")
|
||||
yield Checkbox("WARNING", self.force_warning, id="force_warning")
|
||||
yield Footer()
|
||||
|
||||
def on_mount(self) -> None:
|
||||
@ -105,8 +100,6 @@ class LogViewerApp(App):
|
||||
rv |= lvl == 'critical' and self.force_critical
|
||||
rv |= lvl == 'error' and self.force_error
|
||||
rv |= lvl == 'warning' and self.force_warning
|
||||
rv |= lvl == 'info' and self.force_info
|
||||
rv |= lvl == 'debug' and self.force_debug
|
||||
return rv
|
||||
|
||||
def _apply_filters_to_log(self, record: logging.LogRecord):
|
||||
@ -156,10 +149,6 @@ class LogViewerApp(App):
|
||||
self.force_error = message.value
|
||||
elif message.checkbox.id == "force_warning":
|
||||
self.force_warning = message.value
|
||||
elif message.checkbox.id == "force_info":
|
||||
self.force_info = message.value
|
||||
elif message.checkbox.id == "force_debug":
|
||||
self.force_debug = message.value
|
||||
|
||||
self._update_display()
|
||||
|
||||
|
12
style.tcss
12
style.tcss
@ -2,20 +2,14 @@
|
||||
layout: vertical;
|
||||
overflow-y: scroll;
|
||||
scrollbar-gutter: stable;
|
||||
height: 80%;
|
||||
height: 1fr;
|
||||
}
|
||||
|
||||
#bottom-bar {
|
||||
layout: grid;
|
||||
grid-size: 2;
|
||||
height: 11%;
|
||||
border-top: solid $primary;
|
||||
}
|
||||
|
||||
#force-bar {
|
||||
layout: grid;
|
||||
grid-size: 5;
|
||||
height: 9%;
|
||||
grid-columns: 1fr 1fr 15 15 15;
|
||||
height: 4;
|
||||
border-top: solid $primary;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user