v0.2.0
This commit is contained in:
20
custom_components/log.py
Normal file
20
custom_components/log.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from nicegui import ui
|
||||
import typing as t
|
||||
|
||||
class MyLog(ui.log):
|
||||
def __init__(self, max_lines: t.Optional[int] = None) -> None:
|
||||
super().__init__(max_lines)
|
||||
|
||||
def debug_emit(self, text: str):
|
||||
self.push(text, classes = "text-grey")
|
||||
|
||||
def info_emit(self, text: str):
|
||||
self.push(text, classes = "text-blue")
|
||||
|
||||
def warning_emit(self, text: str):
|
||||
self.push(text, classes = "text-orange")
|
||||
|
||||
def error_emit(self, text: str):
|
||||
self.push(text, classes = "text-red")
|
||||
|
||||
__all__ = ['MyLog']
|
||||
Reference in New Issue
Block a user