PHP Class WPDKWatchDog

## Overview The WPDKWatchDog class manage a standard log system to trace your own data. A log file is formatted with the time of the day. So, every day you found a log file. All log file are put into the default folder 'logs', on main path of instance class. ## Getting started You rarely need to instantiate this class. The WPDKWordPressPlugin class create a WPDKWatchDog's instance for us and then set WPDKWatchDog pointer in log property of WPDKWordPressPlugin subclasses.
Author: =undo= ([email protected])
Show file Open project: wpxtreme/wpdk

Public Properties

Property Type Description
$available boolean Get TRUE if log is available. Could be FALSE if file is not writeable
$enabled boolean Get/Set Enabled log. Default TRUE
$extensionFilename string Return the Log filename extension. Default 'php'
$logname string Get the generate log filename: YYYY-MM-DD.php
$path string Get the complete path of log
$prefix string Return prefix to add date filename. Eg wpxss-20120912.php. Default empty.
$separator string Get/Set the line separator gap in log events
$triggerError boolean Get/Set Enabled trigger error. Default FALSE

Public Methods

Method Description
__construct ( string $path, string $folder = 'logs', string $extension = 'php' ) : WPDKWatchDog Create an instance of WPDKWatchDog class
log ( mixed $txt, mixed $args = null ) : boolean Write a content in log.

Method Details

__construct() public method

Create an instance of WPDKWatchDog class
public __construct ( string $path, string $folder = 'logs', string $extension = 'php' ) : WPDKWatchDog
$path string Path of main file
$folder string Name of log folder, default 'logs'
$extension string This is the extension of single log filename, default 'php'
return WPDKWatchDog

log() public method

Write a content in log.
public log ( mixed $txt, mixed $args = null ) : boolean
$txt mixed Content to log. Usually this is a string or number. However you can set this param direcly to object or array. In this case the log method recognize the not string param and do a `var_dump`.
$args mixed Optional. ...
return boolean

Property Details

$available public property

Get TRUE if log is available. Could be FALSE if file is not writeable
public bool $available
return boolean

$enabled public property

Get/Set Enabled log. Default TRUE
public bool $enabled
return boolean

$extensionFilename public property

Return the Log filename extension. Default 'php'
public string $extensionFilename
return string

$logname public property

Get the generate log filename: YYYY-MM-DD.php
public string $logname
return string

$path public property

Get the complete path of log
public string $path
return string

$prefix public property

Return prefix to add date filename. Eg wpxss-20120912.php. Default empty.
public string $prefix
return string

$separator public property

Get/Set the line separator gap in log events
public string $separator
return string

$triggerError public property

Get/Set Enabled trigger error. Default FALSE
public bool $triggerError
return boolean