jLogErrorMessage
in package
implements
jILogMessage
this class is formatting an error message for a logger.
Tags
Interfaces, Classes and Traits
- jILogMessage
- interface for log message. A component which want to log a message can use an object implementing this interface.
Table of Contents
- $category : mixed
- $code : mixed
- $file : mixed
- $format : mixed
- $line : mixed
- $message : mixed
- $trace : mixed
- __construct() : mixed
- getCategory() : string
- return the category of the message.
- getCode() : string
- getFile() : string
- getFormatedMessage() : string
- return the full message, formated for simple text output (it can contain informations other than the message itself).
- getLine() : int
- getMessage() : string
- getTrace() : array<string|int, mixed>
- setFormat() : mixed
- set the pattern to format the message output.
- sanitizeParams() : mixed
Properties
$category
protected
mixed
$category
Tags
$code
protected
mixed
$code
Tags
$file
protected
mixed
$file
Tags
$format
protected
mixed
$format
= '%date%\\t%ip%\\t[%code%]\\t%msg%\\t%file%\\t%line%\\n\\t%url%\\n%params%\\n%trace%'
Tags
$line
protected
mixed
$line
Tags
$message
protected
mixed
$message
Tags
$trace
protected
mixed
$trace
Tags
Methods
__construct()
public
__construct(string $category, int $code, string $message, string $file, int $line, array<string|int, mixed> $trace) : mixed
Parameters
- $category : string
-
category of the message (error, warning...)
- $code : int
-
error code
- $message : string
-
error message
- $file : string
-
file path + file name where the error appeared
- $line : int
-
the line where the error appeared
- $trace : array<string|int, mixed>
-
stack trace
Tags
Return values
mixed —getCategory()
return the category of the message.
public
getCategory() : string
Tags
Return values
string —category of the message (error, warning...)
getCode()
public
getCode() : string
Tags
Return values
string —error code
getFile()
public
getFile() : string
Tags
Return values
string —file path + file name where the error appeared
getFormatedMessage()
return the full message, formated for simple text output (it can contain informations other than the message itself).
public
getFormatedMessage() : string
Tags
Return values
string —formated error message
getLine()
public
getLine() : int
Tags
Return values
int —the line where the error appeared
getMessage()
public
getMessage() : string
Tags
Return values
string —error message
getTrace()
public
getTrace() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —the stack trace
setFormat()
set the pattern to format the message output.
public
setFormat(string $format) : mixed
Parameters
- $format : string
Tags
Return values
mixed —sanitizeParams()
protected
sanitizeParams(mixed $params) : mixed
Parameters
- $params : mixed