logging
logger trait - logging functions using Logger healper
Tags
Table of Contents
- error() : object
- wp_error with logging
- fatal() : void
- fatal error with logging
- log() : object|void
- PSR-3 Log
- logAlways() : void
- console/file logging - always
- logData() : void
- console/file logging - data (warning)
- logDebug() : void
- console/file logging - debug
- logError() : void
- console/file logging - error
- logInfo() : void
- console/file logging - info (notice)
- logNotice() : void
- console/file logging - notice
- logWarning() : void
- console/file logging - warning
- logWrite() : void
- console/file logging
Methods
error()
wp_error with logging
public
error(string|int|object $code[, string $message = '' ][, mixed $data = '' ][, string $id = '' ][, mixed $isCritical = false ]) : object
Parameters
- $code : string|int|object
-
Error code or wp_error or throwable instance
- $message : string = ''
-
Error message
- $data : mixed = ''
-
optional, Error data
- $id : string = ''
-
optional, source id
- $isCritical : mixed = false
Return values
object —WP_Error object
fatal()
fatal error with logging
public
fatal(string|int $code[, string $message = '' ][, mixed $data = '' ][, string $id = null ]) : void
Parameters
- $code : string|int
-
Error code
- $message : string = ''
-
Error message
- $data : mixed = ''
-
optional, Error data
- $id : string = null
-
optional, source id
Return values
void —log()
PSR-3 Log
public
log([int|string $level = '' ][, mixed $message = '' ][, array<string|int, mixed> $context = [] ]) : object|void
Parameters
- $level : int|string = ''
-
PHP or PSR error level
- $message : mixed = ''
- $context : array<string|int, mixed> = []
-
[key=>value] array for interpolation of $message
Return values
object|void —logger object or void on log()
logAlways()
console/file logging - always
public
logAlways(mixed $variable[, mixed $message = '' ][, array<string|int, mixed> $context = [] ]) : void
Parameters
- $variable : mixed
-
variable to log, WP_Error object, throwable object
- $message : mixed = ''
- $context : array<string|int, mixed> = []
-
[key=>value] array for interpolation of $message
Return values
void —logData()
console/file logging - data (warning)
public
logData(mixed $variable[, mixed $message = '' ][, array<string|int, mixed> $context = [] ]) : void
Parameters
- $variable : mixed
-
variable to log, WP_Error object, throwable object
- $message : mixed = ''
- $context : array<string|int, mixed> = []
-
[key=>value] array for interpolation of $message
Tags
Return values
void —logDebug()
console/file logging - debug
public
logDebug(mixed $variable[, mixed $message = '' ][, array<string|int, mixed> $context = [] ]) : void
Parameters
- $variable : mixed
-
variable to log, WP_Error object, throwable object
- $message : mixed = ''
- $context : array<string|int, mixed> = []
-
[key=>value] array for interpolation of $message
Return values
void —logError()
console/file logging - error
public
logError(mixed $variable[, mixed $message = '' ][, array<string|int, mixed> $context = [] ]) : void
Parameters
- $variable : mixed
-
variable to log, WP_Error object, throwable object
- $message : mixed = ''
- $context : array<string|int, mixed> = []
-
[key=>value] array for interpolation of $message
Return values
void —logInfo()
console/file logging - info (notice)
public
logInfo(mixed $variable[, mixed $message = '' ][, array<string|int, mixed> $context = [] ]) : void
Parameters
- $variable : mixed
-
variable to log, WP_Error object, throwable object
- $message : mixed = ''
- $context : array<string|int, mixed> = []
-
[key=>value] array for interpolation of $message
Return values
void —logNotice()
console/file logging - notice
public
logNotice(mixed $variable[, mixed $message = '' ][, array<string|int, mixed> $context = [] ]) : void
Parameters
- $variable : mixed
-
variable to log, WP_Error object, throwable object
- $message : mixed = ''
- $context : array<string|int, mixed> = []
-
[key=>value] array for interpolation of $message
Return values
void —logWarning()
console/file logging - warning
public
logWarning(mixed $variable[, mixed $message = '' ][, array<string|int, mixed> $context = [] ]) : void
Parameters
- $variable : mixed
-
variable to log, WP_Error object, throwable object
- $message : mixed = ''
- $context : array<string|int, mixed> = []
-
[key=>value] array for interpolation of $message
Return values
void —logWrite()
console/file logging
public
logWrite(int $level, mixed $variable[, mixed $message = '' ][, array<string|int, mixed> $context = [] ]) : void
Parameters
- $level : int
-
the debugging log level
- $variable : mixed
-
variable to log, WP_Error object, throwable object
- $message : mixed = ''
- $context : array<string|int, mixed> = []
-
[key=>value] array for interpolation of $message