Prevent autoscrolling when calling ui.log.push() #1281
jt48
started this conversation in
Ideas / Feature Requests
Replies: 2 comments 1 reply
-
Hi @jt48! |
Beta Was this translation helpful? Give feedback.
0 replies
-
I also have my program logging to an ui.log() element. I used the code of the ui.log documentation and modified it with a formatter: class LogElementHandler(logging.Handler):
"""A logging handler that emits messages to a log element."""
def __init__(self, element: ui.log, level: int = logging.NOTSET) -> None:
self.element = element
super().__init__(level)
self.formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s', datefmt='%Y-%m-%dT%H:%M:%S%z')
def emit(self, record: logging.LogRecord) -> None:
try:
msg = self.format(record)
self.element.push(msg)
except Exception:
self.handleError(record) My problem is the other way around. This means that autoscrolling no longer works for me with this example. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Question
Hi - Is there any way to prevent the ui.log element from scrolling right to the bottom when ui.log.push() is called?
I currently have my program logging frequently to the ui.log element and would like to able to scroll up to read the logs as it's being updated. Any help is appreciated.
Cheers - Josh
Beta Was this translation helpful? Give feedback.
All reactions