Explore Server Side Testing SDK for PHP

DefaultLogger implements LoggerInterface

Table of Contents

Interfaces

LoggerInterface

Constants

LOG_LEVEL_ALERT  = 1
LOG_LEVEL_CRITICAL  = 2
LOG_LEVEL_DEBUG  = 7
LOG_LEVEL_EMERGENCY  = 0
LOG_LEVEL_ERROR  = 3
LOG_LEVEL_INFO  = 6
LOG_LEVEL_KEY_ALERT  = \Psr\Log\LogLevel::ALERT
LOG_LEVEL_KEY_ALL  = 'all'
LOG_LEVEL_KEY_CRITICAL  = \Psr\Log\LogLevel::CRITICAL
LOG_LEVEL_KEY_DEBUG  = \Psr\Log\LogLevel::DEBUG
LOG_LEVEL_KEY_EMERGENCY  = \Psr\Log\LogLevel::EMERGENCY
LOG_LEVEL_KEY_ERROR  = \Psr\Log\LogLevel::ERROR
LOG_LEVEL_KEY_INFO  = \Psr\Log\LogLevel::INFO
LOG_LEVEL_KEY_NOTICE  = \Psr\Log\LogLevel::NOTICE
LOG_LEVEL_KEY_WARNING  = \Psr\Log\LogLevel::WARNING
LOG_LEVEL_NOTICE  = 5
LOG_LEVEL_WARNING  = 4

Properties

$LOG_LEVELS  : array<string|int, mixed>
$logs  : mixed

Methods

alert()  : mixed
clearLogs()  : void
Clear all logs
critical()  : mixed
debug()  : mixed
emergency()  : mixed
error()  : mixed
getLogs()  : array<string|int, mixed>
Get the logs
info()  : mixed
log()  : mixed
notice()  : mixed
warning()  : mixed

Constants

LOG_LEVEL_KEY_ALERT

public string LOG_LEVEL_KEY_ALERT = \Psr\Log\LogLevel::ALERT

LOG_LEVEL_KEY_CRITICAL

public string LOG_LEVEL_KEY_CRITICAL = \Psr\Log\LogLevel::CRITICAL

LOG_LEVEL_KEY_DEBUG

public string LOG_LEVEL_KEY_DEBUG = \Psr\Log\LogLevel::DEBUG

LOG_LEVEL_KEY_EMERGENCY

public string LOG_LEVEL_KEY_EMERGENCY = \Psr\Log\LogLevel::EMERGENCY

LOG_LEVEL_KEY_ERROR

public string LOG_LEVEL_KEY_ERROR = \Psr\Log\LogLevel::ERROR

LOG_LEVEL_KEY_INFO

public string LOG_LEVEL_KEY_INFO = \Psr\Log\LogLevel::INFO

LOG_LEVEL_KEY_NOTICE

public string LOG_LEVEL_KEY_NOTICE = \Psr\Log\LogLevel::NOTICE

LOG_LEVEL_KEY_WARNING

public string LOG_LEVEL_KEY_WARNING = \Psr\Log\LogLevel::WARNING

Properties

$LOG_LEVELS

private static array<string|int, mixed> $LOG_LEVELS = [\Psr\Log\LogLevel::EMERGENCY => self::LOG_LEVEL_EMERGENCY, \Psr\Log\LogLevel::ALERT => self::LOG_LEVEL_ALERT, \Psr\Log\LogLevel::CRITICAL => self::LOG_LEVEL_CRITICAL, \Psr\Log\LogLevel::ERROR => self::LOG_LEVEL_ERROR, \Psr\Log\LogLevel::WARNING => self::LOG_LEVEL_WARNING, \Psr\Log\LogLevel::NOTICE => self::LOG_LEVEL_NOTICE, \Psr\Log\LogLevel::INFO => self::LOG_LEVEL_INFO, \Psr\Log\LogLevel::DEBUG => self::LOG_LEVEL_DEBUG]

Methods

alert()

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

clearLogs()

Clear all logs

public static clearLogs() : void

critical()

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

debug()

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

emergency()

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

error()

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

getLogs()

Get the logs

public static getLogs([string|null $level = null ]) : array<string|int, mixed>
Parameters
$level : string|null = null

Filter logs by level. If null, returns error and higher level logs

Return values
array<string|int, mixed>

info()

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

log()

public log(string $level, string $message[, array<string|int, mixed> $context = [] ]) : mixed
Parameters
$level : string
$message : string
$context : array<string|int, mixed> = []

notice()

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

warning()

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

        
On this page

Search results