theodox / mGui

Python module for cleaner maya GUI layout syntax
MIT License
123 stars 23 forks source link

Build logging support #19

Closed kartikg3 closed 7 years ago

kartikg3 commented 9 years ago

Do you think we should replace all print statements of tracebacks and user feedback to use Python's logging API?

kartikg3 commented 9 years ago

This way the output can be channeled to a file/different streams/sockets and all the other goodies Python logging provides. What are your thoughts on this?

theodox commented 9 years ago

I have not really thought it through. I don't really intend to leave those in there over the long run, they're useful while the API evolves but it's not something I think of as a feature -- most of the ones in there are only there because I forgot to take out debug code.

Another way to handle it would be to create a system using Events, which could fire messages as needed without knowing about the receiving end; then you could add handlers for that events that tied in to logging or other structures of your own

theodox commented 9 years ago

Ooops, did not mean to close

kartikg3 commented 9 years ago

Oh yes that is a great idea! Having a logging system in place that can be connected to events if needed to route info to log files, streams and what not.

theodox commented 7 years ago

This has been dormant for a long time.... I'm closing it since I haven't felt the need for it and the current code base contains basically no prints (there's one exception traceback print which should get changed to a cmds.error and a warning message in the event __del__ which should become a real warning