Neuron-PHP

Logger
in package
implements ILogger

Single Logger implementation.

Tags
SuppressWarnings

(PHPMD.TooManyPublicMethods)

Table of Contents

Interfaces

ILogger
Logger interface.

Properties

$_context  : array<string|int, mixed>
$_destination  : DestinationBase
$_runLevel  : RunLevel
$channel  : string|null

Methods

__construct()  : mixed
addFilter()  : bool
alert()  : void
close()  : void
critical()  : void
debug()  : void
emergency()  : void
error()  : void
getChannel()  : string|null
Get the channel name for this logger.
getContext()  : array<string|int, mixed>
getDestination()  : mixed
getRunLevel()  : RunLevel
info()  : void
log()  : void
notice()  : void
open()  : mixed
removeFilter()  : bool
reset()  : void
setChannel()  : void
Set the channel name for this logger.
setContext()  : void
Add a context value to the log. Contexts are prepended to each log entry.
setDestination()  : void
setRunLevel()  : void
setRunLevelText()  : void
Sets the run level by text.
warning()  : void
interpolate()  : string
Interpolates context values into the message placeholders.

Properties

$_context

private array<string|int, mixed> $_context = []

$channel

private string|null $channel = null

Methods

alert()

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

critical()

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

debug()

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

emergency()

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

error()

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

getChannel()

Get the channel name for this logger.

public getChannel() : string|null
Return values
string|null

getContext()

public getContext() : array<string|int, mixed>
Return values
array<string|int, mixed>

getDestination()

public getDestination() : mixed

info()

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

log()

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

notice()

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

open()

public open(array<string|int, mixed> $params) : mixed
Parameters
$params : array<string|int, mixed>

removeFilter()

public removeFilter(IFilter $filter) : bool
Parameters
$filter : IFilter
Return values
bool

setChannel()

Set the channel name for this logger.

public setChannel(string|null $channel) : void
Parameters
$channel : string|null

setContext()

Add a context value to the log. Contexts are prepended to each log entry.

public setContext(string $name, mixed $value) : void
Parameters
$name : string
$value : mixed

Can be string, array, or other scalar/object types

setRunLevel()

public setRunLevel(mixed $level) : void
Parameters
$level : mixed

string|int either the run level or a string representation of it.

Tags
throws
Exception

setRunLevelText()

Sets the run level by text.

public setRunLevelText(string $level) : void
Parameters
$level : string
Tags
throws
Exception

warning()

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

interpolate()

Interpolates context values into the message placeholders.

private interpolate(string $message, array<string|int, mixed> $context) : string

Implements PSR-3 style message interpolation.

Parameters
$message : string
$context : array<string|int, mixed>
Return values
string

        
On this page

Search results