H.Merijn Brand wrote:
On Wed, 13 Dec 2006 11:31:00 -0800, Dean Arnold <[EMAIL PROTECTED]>
wrote:
Has there been any thought to extending the target for
trace() beyond simple filenames ? I'm looking for a means
to supply either a coderef, or maybe an object implementing
a simple print/write interface. My need is to be able to direct
the traces to a centrally managed logging facility, and be able
to turn them off/on as needed, e.g:
Instead of a coderef, I would suggest accepting file handles.
As the simple
open my $handle, ">", \$scalar;
is a way to get your trace in a string if that would work, passing that
string to a sub would solve your case too. I've just done something similar
in a module that ties filehandles to functions, so if trace () were to accept
file handles in all allowed formats (also IO::Handle), that would be generic
enough to cover all needs.
To clarify, I presume you mean trace() is modified to support (possibly tied)
filehandles in addition to simple filenames ? And then the app can supply
a tied filehandle ?
- Dean