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.
ファイルを表示
Open project: wpxtreme/wpdk
Public Properties
Public Methods
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 |
|
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_oe property
Get TRUE if log is available. Could be FALSE if file is not writeable
public bool $available |
return |
boolean |
|
$enabled public_oe property
Get/Set Enabled log. Default TRUE
public bool $enabled |
return |
boolean |
|
$extensionFilename public_oe property
Return the Log filename extension. Default 'php'
public string $extensionFilename |
return |
string |
|
$logname public_oe property
Get the generate log filename: YYYY-MM-DD.php
public string $logname |
return |
string |
|
Get the complete path of log
public string $path |
return |
string |
|
$prefix public_oe property
Return prefix to add date filename. Eg wpxss-20120912.php. Default empty.
public string $prefix |
return |
string |
|
$separator public_oe property
Get/Set the line separator gap in log events
public string $separator |
return |
string |
|
$triggerError public_oe property
Get/Set Enabled trigger error. Default FALSE
public bool $triggerError |
return |
boolean |
|