GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Squatting::With::Log(3) User Contributed Perl Documentation Squatting::With::Log(3)

Squatting::With::Log - a simple error log for Squatting apps

Adding 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');
    }
  )

Squatting::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.

Squatting apps may set the following values in their %CONFIG hash to control the behavior of this module.
with.log.path
This should be a string that specifies the full path to where you want the logs to be sent.

Example:

  $CONFIG{'with.log.path'} = "/tmp/error_log";
    
with.log.levels
This should be a comma-separated string that lists all the log levels you want to enable.

Example: Only output messages with a log level of "error" or "fatal".

  $CONFIG{'with.log.levels'} = "error,fatal";
    

$log = Squatting::Log->new(\%config)

$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.

$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.

$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.

Catalyst::Log - The Squatting::Log API is the same as the Catalyst::Log API.
2013-01-23 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.