Re: [Catalyst] Subclass $c->log->debug(...) to prepend "${\$c->action}: ..."

2010-01-18 Thread J. Shirley
On Mon, Jan 18, 2010 at 12:22 PM, Kiffin Gish wrote: > I'd like to subclass $c->log->debug(message) so that it prints out: > > ''.$c->action.': '.'message' > > What's the easiest way to do this? > Easiest is to just switch to Catalyst::Log::Log4perl, since it will do what you want out of the box.

Re: [Catalyst] Error handling

2010-01-18 Thread J. Shirley
On Mon, Jan 18, 2010 at 5:44 PM, Steve Kleiman wrote: > Thanks for getting back, t0m. > > By "abort all processing" it seemed like when the error was thrown, Catalyst > stopped processing the request. > > Here's my fabricated error in a controller: > >> sub test_error : Local { >>       my ( $sel

Re: [Catalyst] Error handling

2010-01-18 Thread Steve Kleiman
Thanks for getting back, t0m. By "abort all processing" it seemed like when the error was thrown, Catalyst stopped processing the request. Here's my fabricated error in a controller: > sub test_error : Local { > my ( $self, $c ) = @_; > Log::Log4perl->get_logger('General')->info('be

Re: [Catalyst] Enabling debug mode with fastcgi..

2010-01-18 Thread Toby Corkindale
On 19/01/10 06:54, Adam Mackler wrote: Hi Toby: The output might be going to your web server log. Try starting your fastcgi script with a -e option (with CATALYST_DEBUG set as well). Looking at the previous posts that Wallace directed me to, it sounds like the debug options with fastcgi have

Re: [Catalyst] Subclass $c->log->debug(...) to prepend "${\$c->action}: ..."

2010-01-18 Thread Jason Galea
not as simple as I thought. I'd be interested to know if there's an easier way.. package MyApp; use MyApp::Catalyst::Log; __PACKAGE__->setup; __PACKAGE__->log( MyApp::Catalyst::Log->new ); around 'log' => sub{ my $orig = shift; my $self = shift; return $self->$orig if @_; my $log = $se

Re: [Catalyst] Enabling debug mode with fastcgi..

2010-01-18 Thread David Schmidt
I am pretty sure debug output went to apache's error log when I last checked. On Mon, Jan 18, 2010 at 8:54 PM, Adam Mackler wrote: > Hi Toby: > > The output might be going to your web server log.  Try starting your > fastcgi script with a -e option (with CATALYST_DEBUG set as well). > > Adam > >

[Catalyst] Subclass $c->log->debug(...) to prepend "${\$c->action}: ..."

2010-01-18 Thread Kiffin Gish
I'd like to subclass $c->log->debug(message) so that it prints out: ''.$c->action.': '.'message' What's the easiest way to do this? -- Kiffin Gish Gouda, The Netherlands ___ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-b

Re: [Catalyst] How to change base class for autogenerated Schema/* files?

2010-01-18 Thread Adam Mackler
Hi Alex: I'm not sure about DBIC, but Rose::DBx::Garden, which creates its own database objects in like manner to the DBIC Loader, has a feature to insert code into the generated base class: http://search.cpan.org/~karman/Rose-DBx-Garden-0.15/lib/Rose/DBx/Garden.pm#init_base_code I guess that wo

Re: [Catalyst] Enabling debug mode with fastcgi..

2010-01-18 Thread Adam Mackler
Hi Toby: The output might be going to your web server log. Try starting your fastcgi script with a -e option (with CATALYST_DEBUG set as well). Adam On Mon, Jan 18, 2010 at 05:03:23PM +1100, Toby Corkindale wrote: > Hi guys, > If you're running a Catalyst app with the fastcgi script (as found i

Re: [Catalyst] Enabling debug mode with fastcgi..

2010-01-18 Thread Wallace Reis
On 18/01/2010, at 03:03, Toby Corkindale wrote: > Hi guys, > If you're running a Catalyst app with the fastcgi script (as found in > scripts/myapp_name_fastcgi.pl), then is there a way to enable the debug mode. > (eg. like running scripts/myapp_server.pl -d) > > I've tried setting CATALYST_DEBUG

Re: [Catalyst] Error handling

2010-01-18 Thread Tomas Doran
Steve Kleiman wrote: Found a post on this mailing list suggesting: sub finalize_error { my ($c) = @_; # Note, not ($self, $c) if ( @{$c->errors} ) { $c->stash->template('error.tt'); # You might also need to forward to the view here yourself return; } $c->NEXT::finalize_error

[Catalyst] Error handling

2010-01-18 Thread Steve Kleiman
Thanks for all the feedback on how to log from within a schema. Log4perl is my hero. I'm still looking for a way to capture runtime errors and ideally email them out in addition to logging to a file. I've tried Catalyst-Action-RenderView-ErrorHandler but that seems to have no impact. I see the

Re: [Catalyst] Re: modules for conditional GET ?

2010-01-18 Thread Bill Moseley
On Sun, Jan 17, 2010 at 11:35 PM, Dami Laurent (PJ) < laurent.d...@justice.ge.ch> wrote: > > > > Indeed, this is exactly what I want to do. The app has a config file (not a > Catalyst > config file, but another file having to do with business logic), and some > super-users > have a mechanism for h

RE: [Catalyst] Login as another user ...

2010-01-18 Thread Kiffin Gish
Doesn't $c->logout() already do that for you? On Mon, 2010-01-18 at 12:08 +0100, Dami Laurent (PJ) wrote: > > >-Message d'origine- > >De : Kiffin Gish [mailto:kiffin.g...@planet.nl] > >Envoyé : lundi, 18. janvier 2010 11:34 > >À : The elegant MVC web framework > >Objet : [Catalyst] Login

RE: [Catalyst] Login as another user ...

2010-01-18 Thread Dami Laurent (PJ)
>-Message d'origine- >De : Kiffin Gish [mailto:kiffin.g...@planet.nl] >Envoyé : lundi, 18. janvier 2010 11:34 >À : The elegant MVC web framework >Objet : [Catalyst] Login as another user ... > >As system administrator who has root access to everything, I want to be >able to login as ano

Re: [Catalyst] Login as another user ...

2010-01-18 Thread David Schmidt
On Mon, Jan 18, 2010 at 11:34 AM, Kiffin Gish wrote: > As system administrator who has root access to everything, I want to be > able to login as another user from my dashboard page. > > What's the best way to achieve this? I tried $c->authenticate without a > password, but this doesn't seem to wo

[Catalyst] Re: modules for conditional GET ?

2010-01-18 Thread Aristotle Pagaltzis
* Dami Laurent (PJ) [2010-01-18 08:35]: > So clients should keep asking for those pages at each request, > and depending on the If-Modified-Since header and on the > timestamp for the config file, the server can decide if it's > worth recomputing the page for that client, or rather send > a cheap

[Catalyst] Login as another user ...

2010-01-18 Thread Kiffin Gish
As system administrator who has root access to everything, I want to be able to login as another user from my dashboard page. What's the best way to achieve this? I tried $c->authenticate without a password, but this doesn't seem to work. -- Kiffin Gish Gouda, The Netherlands

[Catalyst] How to change base class for autogenerated Schema/* files?

2010-01-18 Thread Alex Povolotsky
Hello! I'm using Catalyst::Model::DBIC::Schema::Loader and autogenerate Schema/*.pm files. I'd like to add some common functionality to some of them, and I'd greatly prefer adding it in one place to copypasting code. How to I change base class for them? Of course that class should inherit