phpDocumentor

MydbLogger
in package
implements LoggerInterface

Implementation of PSR-3 Logger that will output to STDERR & STDOUT

Tags
author

Sergei Shilko contact@sshilko.com

license

https://opensource.org/licenses/mit-license.php MIT

see
https://github.com/sshilko/php-sql-mydb
see
https://www.php-fig.org/psr/psr-3/

Table of Contents

Interfaces

LoggerInterface

Constants

IO_WRITE_ATTEMPTS  = 3

Properties

$stdeol  : string
End of line delimiter
$stderr  : resource
Opened resource, STDERR
$stdout  : resource
Opened resource, STDOUT

Methods

__construct()  : mixed
__destruct()  : mixed
alert()  : void
critical()  : void
debug()  : void
emergency()  : void
error()  : void
info()  : void
log()  : void
notice()  : void
warning()  : void
checkStreamResource()  : void
formatter()  : string
fwrite()  : int|null
writeOutput()  : void

Constants

IO_WRITE_ATTEMPTS

protected mixed IO_WRITE_ATTEMPTS = 3

Properties

$stdeol

End of line delimiter

protected string $stdeol = \PHP_EOL

Methods

__construct()

public __construct([resource $stdout = STDOUT ][, resource $stderr = STDERR ][, string $stdeol = PHP_EOL ]) : mixed
Parameters
$stdout : resource = STDOUT
$stderr : resource = STDERR
$stdeol : string = PHP_EOL
Tags
psalm-suppress

MissingParamType

throws
LoggerException

alert()

public alert(array<string|int, mixed>|string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : array<string|int, mixed>|string
$context : array<string|int, mixed> = []
Tags
throws
LoggerException

critical()

public critical(array<string|int, mixed>|string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : array<string|int, mixed>|string
$context : array<string|int, mixed> = []
Tags
throws
LoggerException

debug()

public debug(array<string|int, mixed>|string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : array<string|int, mixed>|string
$context : array<string|int, mixed> = []
Tags
throws
LoggerException

emergency()

public emergency(array<string|int, mixed>|string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : array<string|int, mixed>|string
$context : array<string|int, mixed> = []
Tags
throws
LoggerException

error()

public error(array<string|int, mixed>|string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : array<string|int, mixed>|string
$context : array<string|int, mixed> = []
Tags
throws
LoggerException

info()

public info(array<string|int, mixed>|string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : array<string|int, mixed>|string
$context : array<string|int, mixed> = []
Tags
throws
LoggerException

log()

public log(mixed $level, array<string|int, mixed>|string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$level : mixed
$message : array<string|int, mixed>|string
$context : array<string|int, mixed> = []
Tags
throws
LoggerException
phpcs:disable

SlevomatCodingStandard.Functions.UnusedParameter.UnusedParameter

notice()

public notice(array<string|int, mixed>|string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : array<string|int, mixed>|string
$context : array<string|int, mixed> = []
Tags
throws
LoggerException

warning()

public warning(array<string|int, mixed>|string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : array<string|int, mixed>|string
$context : array<string|int, mixed> = []
Tags
throws
LoggerException

formatter()

protected static formatter(string|array<string|int, mixed> $var) : string
Parameters
$var : string|array<string|int, mixed>
Return values
string

fwrite()

protected fwrite(resource $stream, string $data) : int|null
Parameters
$stream : resource
$data : string
Return values
int|null

        
On this page

Search results