shipcloud PHP Client

Logger
in package

Logger Class to log certain events.

Tags
example
use shipcloud\phpclient\Logger;
Logger::get_instance()->log( 'msg', 'info' );
category

Class

author

Daniel Muenter info@msltns.com

version
0.0.1
since
0.0.1
license

GPL 3 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 3, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

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 = ''
Return values
void

Search results