PHP Class MC4WP_Debug_Log

Simple logging class which writes to a file, loosely based on PSR-3.
Afficher le fichier Open project: dannyvankooten/mailchimp-for-wordpress

Méthodes publiques

Свойство Type Description
$file The file to which messages should be written.
$level Only write messages with this level or higher

Protected Properties

Свойство Type Description
$levels array Logging levels from syslog protocol defined in RFC 5424
$stream resource

Méthodes publiques

Méthode Description
__construct ( string $file, $level = self::DEBUG ) MC4WP_Debug_Log constructor.
debug ( string $message ) : boolean
error ( string $message ) : boolean
get_level_name ( integer $level ) : string Gets the name of the logging level.
info ( string $message ) : boolean
log ( mixed $level, string $message ) : boolean
test ( ) : boolean Tests if the log file is writable
to_level ( $level ) : integer Converts PSR-3 levels to local ones if necessary
warning ( string $message ) : boolean

Method Details

__construct() public méthode

MC4WP_Debug_Log constructor.
public __construct ( string $file, $level = self::DEBUG )
$file string

debug() public méthode

public debug ( string $message ) : boolean
$message string
Résultat boolean

error() public méthode

public error ( string $message ) : boolean
$message string
Résultat boolean

get_level_name() public static méthode

Gets the name of the logging level.
public static get_level_name ( integer $level ) : string
$level integer
Résultat string

info() public méthode

public info ( string $message ) : boolean
$message string
Résultat boolean

log() public méthode

public log ( mixed $level, string $message ) : boolean
$level mixed
$message string
Résultat boolean

test() public méthode

Tests if the log file is writable
public test ( ) : boolean
Résultat boolean

to_level() public static méthode

Converts PSR-3 levels to local ones if necessary
public static to_level ( $level ) : integer
Résultat integer

warning() public méthode

public warning ( string $message ) : boolean
$message string
Résultat boolean

Property Details

$file public_oe property

The file to which messages should be written.
public $file

$level public_oe property

Only write messages with this level or higher
public $level

$levels protected_oe static_oe property

Logging levels from syslog protocol defined in RFC 5424
protected static array $levels
Résultat array

$stream protected_oe property

protected resource $stream
Résultat resource