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']
