Re: Logging STDERR and other output
- From: dermot@xxxxxxxxxxxxxxxx (Beginner)
- Date: Thu, 30 Aug 2007 17:25:28 +0100
On 30 Aug 2007 at 10:07, Mumia W. wrote:
On 08/30/2007 09:37 AM, Beginner wrote:
[...]
I tried the INIT option and that worked also and I liked the fact
that my `perl -c myscript.pl` sent it's output to screen and not my
log file and I can use a scalar for logfile.
q1) Does this still give me the effect of getting any errors from the
other modules directed to our $logfile?
Probably not. There's no better way than to try it and see if it works.
Read "perldoc perlmod" too.
Not sure how conclusive this is but if I put
print STDERR "Just testing\n";
in one of the used modules it does get logged to the logfile. However
is appears at the top of the log!! Before all the other messages even
thought that module's functions are not called to near the end.
q2) Will our $logfile now be a shared variable across all my modules?Try it and see.
No. It's not.
q3) The $debug/verbose question: Will I have to pass subroutines in
other modules the $debug value if I am going to ask for more output,
or if I do the same to $debug as I did with $logfile, use our instead
of my. Will that allow those subroutines to check if debug is
enabled?
Most people create a logging module if they want total control over
logging. That module might have a packag $debug_level variable that
determines how much information is logged.
However, the Perl error and warning messages don't fit your logging
model, so you'll probably have to write something yourself or find it on
CPAN.
Log::Handler looks pretty comprehensive.
Thanx for the tips.
Dp.
.
- Follow-Ups:
- Re: Logging STDERR and other output
- From: Dr.Ruud
- Re: Logging STDERR and other output
- References:
- Logging STDERR and other output
- From: Beginner
- Re: Logging STDERR and other output
- From: Beginner
- Re: Logging STDERR and other output
- From: Mumia W.
- Logging STDERR and other output
- Prev by Date: Re: marine subroutine
- Next by Date: html template and tables
- Previous by thread: Re: Logging STDERR and other output
- Next by thread: Re: Logging STDERR and other output
- Index(es):
Relevant Pages
|
|