Logger
in package
Logger Class to log certain events.
Tags
Table of Contents
- $instance : Logger
- Instance object of this class.
- $logger : Logger
- The actual logger object wrapped in this instance.
- error() : void
- Logs an error message. Same as Logger::log() giving second argument string 'error'.
- get_instance() : Logger
- Get an instance.
- info() : void
- Logs an info message. Same as Logger::log() giving second argument string 'info'.
- log() : void
- Logs a message of given type and context. If no level is given it logs at info level.
- warn() : void
- Logs a warning message. Same as Logger::log() giving second argument string 'warning'.
- warning() : void
- Logs a warning message. Same as Logger::log() giving second argument string 'warning'.
- __construct() : void
- Logger constructor set private regarding singleton pattern usage.
- init() : void
- Init method
Properties
$instance
Instance object of this class.
private
static Logger
$instance
$logger
The actual logger object wrapped in this instance.
private
static Logger
$logger
Methods
error()
Logs an error message. Same as Logger::log() giving second argument string 'error'.
public
static error(mixed $msg) : void
Parameters
- $msg : mixed
Return values
void —get_instance()
Get an instance.
public
static get_instance([string $name = '' ][, string $logfile = '' ]) : Logger
Parameters
- $name : string = ''
- $logfile : string = ''
Return values
Logger —info()
Logs an info message. Same as Logger::log() giving second argument string 'info'.
public
static info(mixed $msg) : void
Parameters
- $msg : mixed
Return values
void —log()
Logs a message of given type and context. If no level is given it logs at info level.
public
static log(mixed $msg[, string $level = 'info' ][, array<string|int, mixed> $context = [] ]) : void
Parameters
- $msg : mixed
- $level : string = 'info'
- $context : array<string|int, mixed> = []
Return values
void —warn()
Logs a warning message. Same as Logger::log() giving second argument string 'warning'.
public
static warn(mixed $msg) : void
Parameters
- $msg : mixed
Return values
void —warning()
Logs a warning message. Same as Logger::log() giving second argument string 'warning'.
public
static warning(mixed $msg) : void
Parameters
- $msg : mixed
Return values
void —__construct()
Logger constructor set private regarding singleton pattern usage.
private
__construct() : void
Return values
void —init()
Init method
private
static init([string $name = '' ][, string $logfile = '' ]) : void
Parameters
- $name : string = ''
- $logfile : string = ''
