[EMAIL PROTECTED] wrote: > Hi all, > I wonder if it is possible to change (temporarily) a built-in function > for logging purposes. > Let me explain: > I want to log all the 'open' operations, recording the file to be > opened, the "mode" (r/w/a...) and (possibly) the module which made the > call. > After that the 'open' can carry on following the standard built-in > path. > Possibly I don't want to have to modify the source of the application > to be logged. > If there is another solution, I am open to any suggestion... > > Bye. >
Would this work? _file = file def file(path, mode): print path, mode return _file(path, mode) -greg -- http://mail.python.org/mailman/listinfo/python-list