Memory
Less than 1 minute
Memory
- Full name:
\Hazaar\Logger\Backend\Memory
- Parent class:
\Hazaar\Logger\Backend
Properties
log
The log entries.
private array{level: int, message: string}[] $log
Methods
__construct
public __construct(mixed $options = []): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$options | mixed |
write
public write(string $message, int $level = LOG_INFO, ?string $tag = null): void
Parameters:
Parameter | Type | Description |
---|---|---|
$message | string | |
$level | int | |
$tag | ?string |
read
Read the log.
public read(int $level = null): array{level: int, message: string}[]
Parameters:
Parameter | Type | Description |
---|---|---|
$level | int | The log level to read. If null, all log entries are returned. |
Return Value:
The log entries
clear
public clear(): void
trace
public trace(): void
Inherited methods
__construct
public __construct(array|\Hazaar\Map $options): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$options | array|\Hazaar\Map |
init
public init(): void
postRun
public postRun(): void
setDefaultOption
public setDefaultOption(string $key, mixed $value): void
Parameters:
Parameter | Type | Description |
---|---|---|
$key | string | |
$value | mixed |
setOption
public setOption(string $key, mixed $value): void
Parameters:
Parameter | Type | Description |
---|---|---|
$key | string | |
$value | mixed |
getOption
public getOption(string $key): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$key | string |
hasOption
public hasOption(string $key): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$key | string |
getLogLevelId
public getLogLevelId(string $level): int
Parameters:
Parameter | Type | Description |
---|---|---|
$level | string |
getLogLevelName
public getLogLevelName(int $level): string
Parameters:
Parameter | Type | Description |
---|---|---|
$level | int |
getCapabilities
public getCapabilities(): string[]
can
public can(string $capability): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$capability | string |
addCapability
protected addCapability(string $capability): void
Parameters:
Parameter | Type | Description |
---|---|---|
$capability | string |
Automatically generated on 2024-11-14