: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
namespace AmpProject\Cli;
use AmpProject\Exception\AmpCliException;
use AmpProject\Exception\Cli\InvalidSapi;
* Abstract class with the individual log levels.
* @package ampproject/amp-toolbox
* Detailed debug information.
* Example: User logs in, SQL logs.
* Normal but significant events.
* Normal, positive outcome.
const SUCCESS = 'success';
* Exceptional occurrences that are not errors.
* Example: Use of deprecated APIs, poor use of an API, undesirable things that are not necessarily wrong.
const WARNING = 'warning';
* Runtime errors that do not require immediate action but should typically be logged and monitored.
* Example: Application component unavailable, unexpected exception.
const CRITICAL = 'critical';
* Action must be taken immediately.
* Example: Entire website down, database unavailable, etc. This should trigger the SMS alerts and wake you up.
const EMERGENCY = 'emergency';
* Ordering to use for log levels.
* Test whether a given log level matches the currently set threshold.
* @param string $logLevel Log level to check.
* @param string $threshold Log level threshold to check against.
* @return bool Whether the provided log level matches the threshold.
public static function matches($logLevel, $threshold)
return array_search($logLevel, self::ORDER, true) >= array_search($threshold, self::ORDER, true);