DebugTrait uses trait:short
Provides debugging and mock-related functionality.
Table of Contents
Constants
- LOGGABLE = 'loggable'
- The 'loggable' parameter constant.
- LOGGER = 'logger'
- The logger parameter constant.
Properties
- $debug : bool
- Indicates if use the debug mode.
- $loggable : bool
- The loggable flag.
- $mock : bool
- The mock flag to test the model.
Methods
- alert() : void
- Action must be taken immediately.
- critical() : void
- Critical conditions.
- debug() : void
- Detailed debug information.
- emergency() : void
- System is unusable.
- error() : void
- Runtime errors that do not require immediate action but should typically be logged and monitored.
- info() : void
- Interesting events.
- initializeMock() : bool
- Initialize the mock flag.
- isMock() : bool
- Indicates if the document use the mock mode.
- log() : void
- Logs with an arbitrary level.
- notice() : void
- Normal but significant events.
- warning() : void
- Exceptional occurrences that are not errors.
- initLoggable() : bool
- Initialize the loggable flag.
- initLogger() : LoggerInterface|null
- Initialize the logger reference.
Constants
LOGGABLE
The 'loggable' parameter constant.
public
mixed
LOGGABLE
= 'loggable'
LOGGER
The logger parameter constant.
public
mixed
LOGGER
= 'logger'
Properties
$debug
Indicates if use the debug mode.
public
bool
$debug
= false
$loggable
The loggable flag.
public
bool
$loggable
= false
$mock
The mock flag to test the model.
public
bool
$mock
= false
Methods
alert()
Action must be taken immediately.
public
alert(string|Stringable $message[, array<string|int, mixed> $context = [] ]) : void
Example: Entire website down, database unavailable, etc. This should trigger the SMS alerts and wake you up.
Parameters
- $message : string|Stringable
- $context : array<string|int, mixed> = []
critical()
Critical conditions.
public
critical(string|Stringable $message[, array<string|int, mixed> $context = [] ]) : void
Example: Application component unavailable, unexpected exception.
Parameters
- $message : string|Stringable
- $context : array<string|int, mixed> = []
debug()
Detailed debug information.
public
debug(string|Stringable $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string|Stringable
- $context : array<string|int, mixed> = []
emergency()
System is unusable.
public
emergency(string|Stringable $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string|Stringable
- $context : array<string|int, mixed> = []
error()
Runtime errors that do not require immediate action but should typically be logged and monitored.
public
error(string|Stringable $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string|Stringable
- $context : array<string|int, mixed> = []
info()
Interesting events.
public
info(string|Stringable $message[, array<string|int, mixed> $context = [] ]) : void
Example: User logs in, SQL logs.
Parameters
- $message : string|Stringable
- $context : array<string|int, mixed> = []
initializeMock()
Initialize the mock flag.
public
initializeMock([array<string|int, mixed> $init = [] ]) : bool
Parameters
- $init : array<string|int, mixed> = []
Return values
boolisMock()
Indicates if the document use the mock mode.
public
isMock([array<string|int, mixed> $init = [] ]) : bool
Parameters
- $init : array<string|int, mixed> = []
Return values
boollog()
Logs with an arbitrary level.
public
log(mixed $level, string|Stringable $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $level : mixed
- $message : string|Stringable
- $context : array<string|int, mixed> = []
notice()
Normal but significant events.
public
notice(string|Stringable $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string|Stringable
- $context : array<string|int, mixed> = []
warning()
Exceptional occurrences that are not errors.
public
warning(string|Stringable $message[, array<string|int, mixed> $context = [] ]) : void
Example: Use of deprecated APIs, poor use of an API, undesirable things that are not necessarily wrong.
Parameters
- $message : string|Stringable
- $context : array<string|int, mixed> = []
initLoggable()
Initialize the loggable flag.
protected
initLoggable([array<string|int, mixed> $init = [] ]) : bool
Parameters
- $init : array<string|int, mixed> = []
Return values
boolinitLogger()
Initialize the logger reference.
protected
initLogger([array<string|int, mixed> $init = [] ][, ContainerInterface|null $container = null ]) : LoggerInterface|null
Parameters
- $init : array<string|int, mixed> = []
- $container : ContainerInterface|null = null