I had to do the following introspection in python and it didnt go too well:
name = sys._getframe(1).f_code
name = "%s:%d %s()" %(os.path.split(name.co_filename)[1],name.co_firstlineno,name.co_name)
For an output like this :
foo.py:22 bar() blah blah
In our debugging output.
I want to prepend anything to stderr with this sort of information -- Is it possible to change the behaviour of print globally within python?