Class: NullLogger
Full name: Azera\Log\NullLogger
No-op logger that discards every message.
This is the default logger returned by AppContext::logger()
when no concrete logger has been registered. It exists so that calling
code can safely invoke $ctx->logger()->info(...) without null-checks
or errors, paying only the cost of a single method call that does
nothing.
Implements the PSR-3 LoggerInterface, so it is interchangeable
with any PSR-3 logger (e.g. Monolog). Register a real logger via
AppContext::set(LoggerInterface::class, $logger).
Public methods
emergency() ·
public function emergency(Stringable|string $message, array $context = []): void
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$message |
Stringable|string | - | |
$context |
array | [] |
Return value
- Type:
void
alert() ·
public function alert(Stringable|string $message, array $context = []): void
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$message |
Stringable|string | - | |
$context |
array | [] |
Return value
- Type:
void
critical() ·
public function critical(Stringable|string $message, array $context = []): void
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$message |
Stringable|string | - | |
$context |
array | [] |
Return value
- Type:
void
error() ·
public function error(Stringable|string $message, array $context = []): void
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$message |
Stringable|string | - | |
$context |
array | [] |
Return value
- Type:
void
warning() ·
public function warning(Stringable|string $message, array $context = []): void
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$message |
Stringable|string | - | |
$context |
array | [] |
Return value
- Type:
void
notice() ·
public function notice(Stringable|string $message, array $context = []): void
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$message |
Stringable|string | - | |
$context |
array | [] |
Return value
- Type:
void
info() ·
public function info(Stringable|string $message, array $context = []): void
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$message |
Stringable|string | - | |
$context |
array | [] |
Return value
- Type:
void
debug() ·
public function debug(Stringable|string $message, array $context = []): void
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$message |
Stringable|string | - | |
$context |
array | [] |
Return value
- Type:
void
log() ·
public function log(mixed $level, Stringable|string $message, array $context = []): void
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$level |
mixed | - | |
$message |
Stringable|string | - | |
$context |
array | [] |
Return value
- Type:
void