--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAMLeNpwXAFETERZyb1cBqew-tv4AJhnPQmhMQAOu7WR02w_7Yg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOAD_W899aTUV6rPy6O_oC17gqSEarXccyKyVhnoB4s6aQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAMLeNpyooq7jVCcVkAi3m07v%2BiuoHcG5b0r4id4%2BYZK7TOw8dw%40mail.gmail.com.
To be honest, I’m still bewildered by the global-ness of the logging module, but if it sounds like using it plainly isn’t fulfilling your needs and that you might be better of writing a small library to help you with it.
# For example, globally forcing all logging to go off
import mylogging
mylogging.force_global('off')
There is one thing I did a while back that has stuck with me though, and that is an “append logging decorator”
@mylogging.log
class MyTool(object):
...
Which mimics what I usually to for classes and logging, which is to use the full module path plus class name as logging root, making logging statements come out like:
22:02:25 - INFO - pifou.pom.path.WindowsPath - Could not replace basename
So that I’d know from where the error came. Traditionally, I’d do something like:
class WindowsPath(object):
log = logging.getLogger('pifou.pom.path.WindowsPath')
And aside from the needless typing and duplicated information, moving the class elsewhere would invalidate the logging information. This would be something the decorator could handle instead.
Possibly not helpful in your scenario, but I can’t offer much else on email notifications and such as I’ve never had to deal with it.
Best,
Marcus
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA1PopiZkJqWFgwFWhBSW_rdfZRLqOxWr0iQYJExf70VSw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOD9N8ty-2GmE_rfXoGA5qDaVbRBa%3DaMZRedeSOs-ZAwxA%40mail.gmail.com.