DebugTrait

trait atk4\core\DebugTrait
Source:vendor/atk4/core/src/DebugTrait.php#7

Properties

public static property atk4\core\DebugTrait::$_debugTrait
Check this property to see if trait is present in the object.
Source:vendor/atk4/core/src/DebugTrait.php#14
Type:bool
public static property atk4\core\DebugTrait::$debug
Source:vendor/atk4/core/src/DebugTrait.php#17
Type:bool Is debug enabled?
protected static property atk4\core\DebugTrait::$_prev_bt
Source:vendor/atk4/core/src/DebugTrait.php#20
Type:array Helps debugTraceChange.

Methods

protected atk4\core\DebugTrait::_echo_stderr($message)
Outputs message to STDERR.
Source:

vendor/atk4/core/src/DebugTrait.php#29

Parameters:
  • $message (string)
public atk4\core\DebugTrait::debug($message=true, $context=[])
Send some info to debug stream.
Source:

vendor/atk4/core/src/DebugTrait.php#42

Parameters:
  • $message (bool | string)
  • $context (array)
Returns:

$this

public atk4\core\DebugTrait::log($level, $message, $context=[])
Output log message.
Source:

vendor/atk4/core/src/DebugTrait.php#71

Parameters:
  • $level (string)
  • $message (string)
  • $context (array)
Returns:

$this

public atk4\core\DebugTrait::userMessage($message, $context=[])
Output message that needs to be acknowledged by application user. Make sure
that $context does not contain any sensitive information.
Source:

vendor/atk4/core/src/DebugTrait.php#91

Parameters:
  • $message (string)
  • $context (array)
Returns:

$this

public atk4\core\DebugTrait::debugTraceChange($trace=default)
Method designed to intercept one of the hardest-to-debug situations within Agile Toolkit.
Suppose you define a hook and the hook needs to be called only once, but somehow it is
being called multiple times. You want to know where and how those calls come through.

Place debugTraceChange inside your hook and give unique $trace identifier. If the method
is invoked through different call paths, this debug info will be logged.

Do not leave this method in production code !!!
Source:

vendor/atk4/core/src/DebugTrait.php#117

Parameters:
  • $trace (string)
public atk4\core\DebugTrait::emergency($message, $context=[])
System is unusable.
Source:

vendor/atk4/core/src/DebugTrait.php#144

Parameters:
  • $message (string)
  • $context (array)
Returns:

void

public atk4\core\DebugTrait::alert($message, $context=[])
Action must be taken immediately.
Example: Entire website down, database unavailable, etc. This should
trigger the SMS alerts and wake you up.
Source:

vendor/atk4/core/src/DebugTrait.php#160

Parameters:
  • $message (string)
  • $context (array)
Returns:

void

public atk4\core\DebugTrait::critical($message, $context=[])
Critical conditions.
Example: Application component unavailable, unexpected exception.
Source:

vendor/atk4/core/src/DebugTrait.php#175

Parameters:
  • $message (string)
  • $context (array)
Returns:

void

public atk4\core\DebugTrait::error($message, $context=[])
Runtime errors that do not require immediate action but should typically
be logged and monitored.
Source:

vendor/atk4/core/src/DebugTrait.php#189

Parameters:
  • $message (string)
  • $context (array)
Returns:

void

public atk4\core\DebugTrait::warning($message, $context=[])
Exceptional occurrences that are not errors.
Example: Use of deprecated APIs, poor use of an API, undesirable things
that are not necessarily wrong.
Source:

vendor/atk4/core/src/DebugTrait.php#205

Parameters:
  • $message (string)
  • $context (array)
Returns:

void

public atk4\core\DebugTrait::notice($message, $context=[])
Normal but significant events.
Source:

vendor/atk4/core/src/DebugTrait.php#218

Parameters:
  • $message (string)
  • $context (array)
Returns:

void

public atk4\core\DebugTrait::info($message, $context=[])
Interesting events.
Example: User logs in, SQL logs.
Source:

vendor/atk4/core/src/DebugTrait.php#233

Parameters:
  • $message (string)
  • $context (array)
Returns:

void