Description

Alexya's Abstract Logger.

Base class for all PSR compatible loggers.

The constructor accepts as parameter a string being the format that each log message will have and an array with the log levels that the logger can log.

All classes that extends this must implement the _write method that accepts as parameter the string to log, this method will write the log message to whatever the child class wants.

The method log performs the actual logging and accepts as parameter the log level (see \Psr\Log\LogLevel for a list of possible values) and the string to log.

There are also 8 methods for logging in a specific category: emergency alert critical error warning notice info debug

All of them accepts as parameter the last 2 parameters of the log method.

Example:

class Logger extends AbstractLogger
{
private function _write(string $message)
{
echo $message;
}
}

$logger = new Logger();
$logger->debug("test"); // test
$logger->debug("{LEVEL}: {MESSAGE}", [
"MESSAGE" => "test"
]); // debug: test

Type hierarchy

amzn/amazon-pay-sdk-php 2.x-dev
View more packages
amzn/login-and-pay-with-amazon-sdk-php 2.x-dev
ortnit/logger dev-master
psr-php7/log dev-master 1.0.0
psr/log dev-master 1.1.3
amzn/amazon-pay-sdk-php 2.x-dev
View more packages
amzn/login-and-pay-with-amazon-sdk-php 2.x-dev
ortnit/logger dev-master
psr-php7/log dev-master 1.0.0
psr/log dev-master 1.1.3

Class usage:

This class is not referred by any other class/interface/traits in packagist packages.