On 5 Mar 2011, at 23:09, Nicholas Wehr wrote:
use the log method of $c:
$c->log->debug("my message");
cheers,
-nw
On Sat, Mar 5, 2011 at 2:21 PM, John M. Dlugosz <[email protected]
> wrote:
How do I send stuff to the console running the script/
Appname_server.pl -d from a component method?
You'll need to capture $c (or better just $c->log?) in some way to do
this of course. It is provided at component setup time
(Catalyst::Role::ApplicationAttribute can be applied to automatically
capture it)..
Alternatively, you can just pick a log framework (e.g. log4perl), and
log into that (bypassing / reusing this logger for $c->log).
It's not entirely trivial as you quite possibly want an abstraction
layer there - e.g. if you're using a model outside Catalyst, then you
probably don't want to load Catalyst just for the logger :)
Cheers
t0m
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/