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


Manual Reference Pages  -  SQUATTING::WITH::LOG (3)

.ds Aq ’

NAME

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

CONTENTS

SYNOPSIS

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



DESCRIPTION

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.

CONFIGURATION

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.

<B>ExampleB>:



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

<B>ExampleB>: Only output messages with a log level of error or fatal.



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



API

    Object 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 ALSO

Catalyst::Log - The Squatting::Log API is the same as the Catalyst::Log API.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 SQUATTING::WITH::LOG (3) 2013-01-23

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