hoffstadt / DearPyGui_Ext

Dear PyGui Extensions: A collection of useful tools, abstractions, and simplification layers built with/for Dear PyGui users.
https://dearpygui-ext.readthedocs.io/en/latest/
MIT License
78 stars 13 forks source link

Logger documentation example #4

Open DataExplorerUser opened 2 years ago

DataExplorerUser commented 2 years ago

The dearpygui-ext documentation still needs some love. It's here, but it's empty. https://dearpygui-ext.readthedocs.io/en/latest/index.html

Cothren's example should be added.

import dearpygui.dearpygui as dpg
import dearpygui.demo as demo
from dearpygui_ext.logger import mvLogger

dpg.create_context()
dpg.create_viewport()

log = mvLogger()
log.log("log")
log.log_debug("log debug")
log.log_info("log info")
log.log_warning("log warning")
log.log_error("log error")
log.log_critical("log critical")

demo.show_demo()

with dpg.window(label="tutorial", width=500, height=500, show=False):
    dpg.add_button(label="Press me", callback=lambda:dpg.toggle_viewport_fullscreen())

# main loop
dpg.show_viewport()
dpg.setup_dearpygui()
dpg.start_dearpygui()
dpg.destroy_context()