Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re: Test::Trap + Log::Dispatch under Cron

by kevbot (Priest)
on Nov 24, 2014 at 23:14 UTC ( #1108293=note: print w/replies, xml ) Need Help??

in reply to Test::Trap + Log::Dispatch under Cron

I really don't have any experience using these modules, but I took a quick look at the documentation for Log::Dispatch::Screen. The screen output seems to default to writing to STDERR. If your Test::Trap code is checking STDOUT, then perhaps that's why you are not getting any output. However, I'm not sure why you would notice this problem only when running under cron.
  • Comment on Re: Test::Trap + Log::Dispatch under Cron

Replies are listed 'Best First'.
Re^2: Test::Trap + Log::Dispatch under Cron
by Solo (Deacon) on Nov 25, 2014 at 20:40 UTC

    Well, the screen output is definitely writing to STDOUT, at least according to Test::Trap.

    I've taken an approach similar to Test::Log::Dispatch and added a code output that appends all messages to an array. I'm not getting the logs with Test::Trap anymore, but it's not a complete change to the rest of the testing approach by needing to read a temp logfile.

    our @log; $logger->add( Log::Dispatch::Code->new( min_level => 'debug', code => +sub { my %entry = @_; push @log, $entry{message}; }};

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1108293]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2021-09-16 22:45 GMT
Find Nodes?
    Voting Booth?

    No recent polls found