[IronPython] Logging module error
Michael Foord
fuzzyman at voidspace.org.uk
Tue Dec 2 13:19:48 CET 2008
Deepali Abhyankar wrote:
> Hi Michael,
>
> This is the only code am writing in ipy.exe
> and getting error
> I am using inbuilt logging module provided by Iron Python.
>
The logging module is not inbuilt to IronPython - it is part of the
Python standard library. As you can see from the traceback the Python
file the error is occurring in is located at:
"C:\Program Files\IronPython 2.0\Lib\logging\__init__.py"
The traceback also gives the line numbers of the errors.
All the best,
Michael Foord
> Deepali
>
>
>
> -----Original Message-----
> From: Michael Foord [mailto:fuzzyman at voidspace.org.uk]
> Sent: Tuesday, December 02, 2008 5:30 PM
> To: deepali_abhyankar at persistent.co.in; Discussion of IronPython
> Subject: Re: [IronPython] Logging module error
>
> Hello Deepali,
>
> sys._getframe is not available in IronPython. If you post the relevant
> section of code from the logging module we may be able to suggest a
> patch / workaround (disabling some functionality may be the way forward
> - but often getframe is used to find a trivial bit of information that
> can be supplied another way).
>
> All the best,
>
> Michael Foord
>
> Deepali Abhyankar wrote:
>
>>
>>
>> Hi
>>
>>
>>
>> I am using Iron Python 2.0 release candidate 2.
>>
>> I am using logging module
>>
>> *Code is*:
>>
>> Import logging
>>
>> logger = logging.getLogger("Trial")
>>
>> logger.setLevel(logging.INFO)
>>
>>
>>
>> hdlr = logging.FileHandler("data.txt","w")
>>
>> hdlr.setLevel(logging.INFO)
>>
>> formatter = logging.Formatter("%(asctime)s-%(name)s-%(message)s")
>>
>> hdlr.setFormatter(formatter)
>>
>> logger.addHandler(hdlr)
>>
>> logger.info(message)
>>
>>
>>
>> *I am facing following error on execution *
>>
>> * *
>>
>> File "C:\Program Files\IronPython 2.0\Lib\logging\__init__.py", line
>> 985, in i
>>
>> nfo
>>
>> File "C:\Program Files\IronPython 2.0\Lib\logging\__init__.py", line
>> 1094, in
>>
>> _log
>>
>> File "C:\Program Files\IronPython 2.0\Lib\logging\__init__.py", line
>> 1063, in
>>
>> findCaller
>>
>> File "C:\Program Files\IronPython 2.0\Lib\logging\__init__.py", line
>> 71, in <l
>>
>> ambda$1>
>>
>> ValueError: _getframe is not implemented for non-zero depth
>>
>>
>>
>> Please suggest solution to resolve this
>>
>>
>>
>>
>> DISCLAIMER ========== This e-mail may contain privileged and
>> confidential information which is the property of Persistent Systems
>> Ltd. It is intended only for the use of the individual or entity to
>> which it is addressed. If you are not the intended recipient, you are
>> not authorized to read, retain, copy, print, distribute or use this
>> message. If you have received this communication in error, please
>> notify the sender and delete all copies of this message. Persistent
>> Systems Ltd. does not accept any liability for virus infected mails.
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.ironpython.com
>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>>
>>
>
>
>
--
http://www.ironpythoninaction.com/
More information about the Ironpython-users
mailing list