GoogleApiAdsCommon
[ class tree: GoogleApiAdsCommon ] [ index: GoogleApiAdsCommon ] [ all elements ]

Class: Logger

Source Location: /Common/Util/Logger.php

Class Overview


A logger class which registers appenders (any writable handle location which can be fopen'ed) with a unique name for that log. The library will write all incoming/outgoing SOAP XML to SOAP_XML_LOG and all records of requests to REQUEST_INFO_LOG.


Variables

Methods



Class Details

[line 44]
A logger class which registers appenders (any writable handle location which can be fopen'ed) with a unique name for that log. The library will write all incoming/outgoing SOAP XML to SOAP_XML_LOG and all records of requests to REQUEST_INFO_LOG.

Currently, levels are only used as indicators (there is no filtering mechanism as of yet).

A list of supported appenders (file handles) can be found here: http://us2.php.net/manual/en/wrappers.php




[ Top ]


Class Variables

static $DEBUG =  'DEBUG'

[line 81]

DEBUG level.



Tags:

var:  the debug level
access:  public

Type:   string


[ Top ]

static $ERROR =  'ERROR'

[line 87]

ERROR level.



Tags:

var:  the error level
access:  public

Type:   string


[ Top ]

static $FATAL =  'FATAL'

[line 93]

FATAL level.



Tags:

var:  the fatal level
access:  public

Type:   string


[ Top ]

static $INFO =  'INFO'

[line 75]

INFO level.



Tags:

var:  the info level
access:  public

Type:   string


[ Top ]

static $REQUEST_INFO_LOG =  'request_info'

[line 55]

Logs all information about requests.



Tags:

var:  log for all information about requests
access:  public

Type:   string


[ Top ]

static $SOAP_XML_LOG =  'soap_xml'

[line 49]

Logs all incomming and outgoing SOAP XML.



Tags:

var:  log for all incomming and outgoing SOAP XML
access:  public

Type:   string


[ Top ]

static $STD_ERR_STREAM =  'php://stderr'

[line 69]

Standard error stream for use with the LogToStream method.



Tags:

var:  stream for stderr
see:  Logger::LogToStream()
access:  public

Type:   string


[ Top ]

static $STD_OUT_STREAM =  'php://stdout'

[line 62]

Standard out stream for use with the LogToStream method.



Tags:

var:  stream for stdout
see:  Logger::LogToStream()
access:  public

Type:   string


[ Top ]



Class Methods


static method Log [line 156]

static void Log( string $log, string $message, [string $level = NULL])

Logs a message to the log at a specific level.



Tags:

access:  public


Parameters:

string   $log   the unique name of the log
string   $message   the message to write
string   $level   the level at which to write the message

[ Top ]

static method LogToFile [line 109]

static void LogToFile( string $log, string $filePath)

Logs the given log to a file at the file path.



Tags:

access:  public


Parameters:

string   $log   the unique name of the log
string   $filePath   the location of the file to append the log to

[ Top ]

static method LogToStream [line 126]

static void LogToStream( string $log, string $phpIoStream)

Logs the given log to a stream represented by $phpIoStream. The availble streams are listed here:

http://us3.php.net/manual/en/wrappers.php.php

The variables $STD_OUT_STREAM and $STD_ERR_STREAM are provided for your convenience.




Tags:

see:  Logger::$STD_OUT_STREAM
see:  Logger::$STD_ERR_STREAM
access:  public


Parameters:

string   $log   the unique name of the log
string   $phpIoStream   the php I/O stream of the form php://*

[ Top ]


Documentation generated by phpDocumentor 1.4.3