Capture logs to string

I’m working on making a command-line server console using urwid and am looking for a way to pull or push the logs generated by panda into python strings so I can display them using urwid’s widgets. The manual has instructions on pushing the logs to a file, but I am hoping there are more graceful options out there. Thanks!