[Ironpython-users] ErrorListener
Markus Schaber
m.schaber at 3s-software.com
Wed Oct 12 16:25:59 CEST 2011
Hi, Keith,
Von: Keith Rome [mailto:rome at Wintellect.com]
>
> Is there a notion of "Warning" in context of execution? My understanding is
> that during execution you either get a single error, or you get the
> resulting value (or void/null if the script does not eval to a return
> value). Any print() messages are routed to the stdout stream which you can
> also intercept via the script engine's IO property. Perhaps that kind of
> trace output is what you are looking for?
At least Python has that notion, and it has been ported to IronPython.
With switches like -t, -b, -3 and -Wall for IPy.exe, corresponding to the options IndentationInconsistencySeverity, BytesWarning, WarnPy3k and WarningFilters passed to Python.CreateEngine(), some of those warnings can be enabled.
While -t only has effect during compilation, -3 and -Wall trigger some warnings during execution (I'm not sure about -b.)
But it seems that those runtime warnings are handled completely inside the python warnings framework, and there the default is simply to write the warning to stdout. I guess I have to override the warnings.showwarning method (as it is documented for python) from hosting environment to achieve what I want.
Best regards
Markus Schaber
--
___________________________
We software Automation.
3S-Smart Software Solutions GmbH
Markus Schaber | Developer
Memminger Str. 151 | 87439 Kempten | Germany | Tel. +49-831-54031-0 | Fax +49-831-54031-50
Email: m.schaber at 3s-software.com | Web: http://www.3s-software.com
CoDeSys internet forum: http://forum.3s-software.com
Download CoDeSys sample projects: http://www.3s-software.com/index.shtml?sample_projects
Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Trade register: Kempten HRB 6186 | Tax ID No.: DE 167014915
More information about the Ironpython-users
mailing list