Ohh great!! Nice and clean code.
Thank you!

2014. március 3., hétfő 21:01:46 UTC+1 időpontban Asi Sudai a következőt 
írta:
>
> I'm a big fan of the logging module too... 
> On GitHub I made a custom Logging module, based on python logging, with 
> support for Maya, Nuke and MotionBuilder unique messages.
> https://github.com/asisudai/cg-logging/blob/master/cgLogging.py
>
> features are:
> - will use Maya or Nuke built-in warning messages
> - will popup a msgbox for FATAL level, so the artists ( which rarely look 
> at the script editor could see )
> - will print to stdout or/and to the application script-editor.
> - Email developer the traceback msg ( feature that isn't on GitHub, but 
> you could add easily to FATAL if you wish )
>
> hope it helps anyone, feel free to contribute or branch this git.
>
>
>
>
> On Monday, March 3, 2014 10:49:02 AM UTC-8, David Lantos wrote:
>>
>> Ok, I've found a solution. ->
>> http://nullege.com/codes/show/src@p@y@pymel-HEAD@[email protected]
>>
>> 2014. március 3., hétfő 19:40:07 UTC+1 időpontban David Lantos a 
>> következőt írta:
>>>
>>> I've got error, MayaGuiLogHandler wants something to eat:
>>>
>>> # Error: unbound method __init__() must be called with Filterer instance 
>>> as first argument (got MayaGuiLogHandler instance instead)
>>> # Traceback (most recent call last):
>>> #   File "<maya console>", line 1, in <module>
>>> #   File "C:\Program 
>>> Files\Autodesk\Maya2013\bin\python26.zip\logging\__init__.py", line 596, in 
>>> __init__
>>> #     Filterer.__init__(self)
>>> # TypeError: unbound method __init__() must be called with Filterer 
>>> instance as first argument (got MayaGuiLogHandler instance instead) #
>>>
>>>
>>>
>>> 2011. december 7., szerda 3:18:52 UTC+1 időpontban Jesse Kretschmer a 
>>> következőt írta:
>>>>
>>>> Yury,
>>>> First create a logging object.  If you are running this from the script 
>>>> editor, you will need to set propagate = False so maya does not catch and 
>>>> resend your message in the format you see above.  Also, I would recommend 
>>>> the log handler provided by PyMel as it is already wired up to the correct 
>>>> error/warning/info events.  It is already available in Maya 2011 or 
>>>> greater.
>>>>
>>>> Try this:
>>>>
>>>> import logging
>>>> import maya.utils
>>>>
>>>> myLogger = logging.getLogger("MyLogger")
>>>> myLogger.propagate = False
>>>> handler = maya.utils.MayaGuiLogHandler()
>>>> handler.setLevel(logging.INFO)
>>>> formatter = logging.Formatter("%(asctime)s %(message)s")
>>>> handler.setFormatter(formatter)
>>>> myLogger.addHandler(handler)
>>>>
>>>> myLogger.warning('is when this event was logged.')
>>>>
>>>>
>>>> Cheers,
>>>>
>>>> -jesse
>>>> On Tue, Dec 6, 2011 at 5:48 PM, ynedelin <[email protected]> wrote:
>>>>
>>>>> I got this from the python docs page
>>>>>
>>>>> if I run this in the script editor:
>>>>>
>>>>> import logging
>>>>> logging.basicConfig(format='%(asctime)s %(message)s')
>>>>> logging.warning('is when this event was logged.')
>>>>>
>>>>> I get this:
>>>>>
>>>>> # Warning: root : is when this event was logged. #
>>>>>
>>>>> How can I get the date to show in the script editor?
>>>>>
>>>>> 2010-12-12 11:41:42,612 is when this event was logged.
>>>>>
>>>>> Yury
>>>>>
>>>>> --
>>>>> view archives: http://groups.google.com/group/python_inside_maya
>>>>> change your subscription settings: 
>>>>> http://groups.google.com/group/python_inside_maya/subscribe
>>>>>
>>>>
>>>>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/e0d6adfd-758e-40a7-bbb7-ea89af334e71%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to