\donbidon\Core\Log\MethodStream

Logging method getting stream from registry.

Usage description.

Summary

Methods
Properties
Constants
__construct()
handler()
onUpdateRegistry()
No public properties found
DEFAULT_LEVEL
DEFAULT_FORMAT
getStream()
log()
init()
checkSource()
checkLevel()
handlerToString()
render()
$reverseLevel
$levelToString
$registry
$evtManager
N/A
No private methods found
No private properties found
N/A

Constants

DEFAULT_LEVEL

DEFAULT_LEVEL = "E_ERROR_WARNING" : string

DEFAULT_FORMAT

DEFAULT_FORMAT = "[ %DATE% %TIME% ] [ %LEVEL% ] [ %SOURCE% ] ~ %MESSAGE%" : string

Properties

$reverseLevel

$reverseLevel : array

Reverse int level to string

Type

array

$levelToString

$levelToString : array

Level to string for message

Type

array

Methods

handler()

handler(string  $name, \donbidon\Core\Event\Args  $args) : void

Logging handler.

Parameters

string $name
\donbidon\Core\Event\Args $args

onUpdateRegistry()

onUpdateRegistry(string  $name, \donbidon\Core\Event\Args  $args) : void

Updating method registry handler.

$evtManager->fire(':updateLogRegistry:', new Args([
    'conditions' => [
        'name'   => "File",
        'level'  => "E_ALL",
    ],
    'changes' => [
        'path' => $path,
    ],
]));

Parameters

string $name
\donbidon\Core\Event\Args $args

getStream()

getStream() : string

Returns stream to write log.

Returns

string

checkSource()

checkSource(string  $source) : boolean

Returns true if passed source published in config file.

Parameters

string $source

Returns

boolean

checkLevel()

checkLevel(integer  $level) : boolean

Returns true if passed level published in config file.

Parameters

integer $level

Throws

\RuntimeException

If invalid level passed.

Returns

boolean

handlerToString()

handlerToString(callable  $handler, string  $name = '') : string

Returns stringified event handler.

Parameters

callable $handler
string $name

Returns

string

render()

render(\donbidon\Core\Event\Args  $args) : string

Renders message according ro format.

Parameters

\donbidon\Core\Event\Args $args

Returns

string