Frontend
About 1 min
Frontend
Logger frontend implementation.
class Frontend implements \Hazaar\Logger\LoggerInterfaceProvides logging functionality using a configurable backend, supporting log levels, context, message interpolation, and PSR-3 compatibility.
Properties
config
private array $configcontext
private array $contextlevel
The minimum log level for messages to be recorded.
private int $level = 'Backend'backend
The backend instance used for logging.
private Backend $backendMethods
__construct
public __construct(array $config): voidParameters
| Parameter | Type | Description |
|---|---|---|
$config | array |
__destruct
Destructor closes the backend and releases resources.
public __destruct(): voidinitialise
Initialise the logger with the given configuration.
public initialise(array $config): voidParameters
| Parameter | Type | Description |
|---|---|---|
$config | array |
setContext
Set the context for the logger.
public setContext(array $context): voidOverwrites the existing context with the provided context array.
Parameters
| Parameter | Type | Description |
|---|---|---|
$context | array |
addContext
Adds additional context information to the logger.
public addContext(array $context): voidMerges the provided context array with the existing context.
Parameters
| Parameter | Type | Description |
|---|---|---|
$context | array | associative array of context data to add |
log
Write a log message to the backend.
public log(mixed $level, \Stringable $message, array $context): voidParameters
| Parameter | Type | Description |
|---|---|---|
$level | mixed | |
$message | \Stringable | |
$context | array | Additional context for the log entry |
emergency
public emergency(\Stringable $message, array $context): voidParameters
| Parameter | Type | Description |
|---|---|---|
$message | \Stringable | |
$context | array |
alert
public alert(\Stringable $message, array $context): voidParameters
| Parameter | Type | Description |
|---|---|---|
$message | \Stringable | |
$context | array |
critical
public critical(\Stringable $message, array $context): voidParameters
| Parameter | Type | Description |
|---|---|---|
$message | \Stringable | |
$context | array |
error
public error(\Stringable $message, array $context): voidParameters
| Parameter | Type | Description |
|---|---|---|
$message | \Stringable | |
$context | array |
warning
public warning(\Stringable $message, array $context): voidParameters
| Parameter | Type | Description |
|---|---|---|
$message | \Stringable | |
$context | array |
notice
public notice(\Stringable $message, array $context): voidParameters
| Parameter | Type | Description |
|---|---|---|
$message | \Stringable | |
$context | array |
info
public info(\Stringable $message, array $context): voidParameters
| Parameter | Type | Description |
|---|---|---|
$message | \Stringable | |
$context | array |
debug
public debug(\Stringable $message, array $context): voidParameters
| Parameter | Type | Description |
|---|---|---|
$message | \Stringable | |
$context | array |
interpolate
Interpolates context values into the message placeholders.
private interpolate(string $message, array $context): stringParameters
| Parameter | Type | Description |
|---|---|---|
$message | string | |
$context | array |
Generated by Hazaar API Doc Generator on Tue, 21 Apr 2026 04:00:23 +0000