VISU - PHP Game Framework

Logger
in package

This VISU Logger class is used to log messages directly to STDOUT.

If you need fancy log redirections, transformations, etc. you should use a PSR-3 compatible logger or monolog. This logger relies on global state and is here to have some control over the STDOUT output.

Table of Contents

Properties

$levelErrorEnabled  : bool
Is the "ERROR" log level enabled?
$levelInfoEnabled  : bool
Is the "INFO" log level enabled?
$levelWarnEnabled  : bool
Is the "WARN" log level enabled?
$maxMessages  : int
The maximum number of messages to keep in the log
$messages  : array<string|int, string>
A rolling array of log messages, this allows us to dump the log messages on request

Methods

error()  : void
Logs a message with the ERROR log level
info()  : void
Logs a message with the INFO log level
warn()  : void
Logs a message with the WARNING log level

Properties

$levelErrorEnabled

Is the "ERROR" log level enabled?

public static bool $levelErrorEnabled = true

$levelInfoEnabled

Is the "INFO" log level enabled?

public static bool $levelInfoEnabled = true

$levelWarnEnabled

Is the "WARN" log level enabled?

public static bool $levelWarnEnabled = true

$maxMessages

The maximum number of messages to keep in the log

public static int $maxMessages = 2048

$messages

A rolling array of log messages, this allows us to dump the log messages on request

public static array<string|int, string> $messages = []

Methods

error()

Logs a message with the ERROR log level

public static error(string $message) : void
Parameters
$message : string

info()

Logs a message with the INFO log level

public static info(string $message) : void
Parameters
$message : string

warn()

Logs a message with the WARNING log level

public static warn(string $message) : void
Parameters
$message : string

        
On this page

Search results