|
NAMESquatting::With::Log - a simple error log for Squatting appsSYNOPSISAdding simple logging to your Squatting app:use App 'With::Log', 'On::CGI'; This will let log from within your controllers: C( Day => [ '/(\d+)/(\d+)/(\d+)' ], get => sub { my ($self, $year, $month, $day) = @_; my $log = $self->log; $log->debug(" year: $year"); $log->info ("month: $month"); $log->warn (" day: $day"); # you also get $log->error and $log->fatal $self->render('day'); } ) DESCRIPTIONSquatting::With::Log provides a simple logging object that can be used from within your controllers to send messages to either a log file or STDERR for informational purposes. Typically, these messages would be useful during development and debugging but would be disabled for production use.To use this module, pass the string 'With::Log' to the "use" statement that loads your Squatting app. CONFIGURATIONSquatting apps may set the following values in their %CONFIG hash to control the behavior of this module.
APIObject Construction$log = Squatting::Log->new(\%config)Configuration$log->enable(@levels)This method enables the list of log levels you send it. $log->disable(@levels) This method disables the list of log levels you send it. Introspection$log->is_debug$log->is_info $log->is_warn $log->is_error $log->is_fatal These methods return true if their respective log levels are enabled. Logging$log->debug(@messages)$log->info(@messages) $log->warn(@messages) $log->error(@messages) $log->fatal(@messages) These methods output the list of log messages you send it using the specified log level. SEE ALSOCatalyst::Log - The Squatting::Log API is the same as the Catalyst::Log API.
Visit the GSP FreeBSD Man Page Interface. |