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