$context Context data. */ public static function log( $message, $level = 'info', $context = [] ) { wcpay_get_container()->get( InternalLogger::class )->log( $message, $level, $context ); } /** * Checks if the gateway setting logging toggle is enabled. * * @return bool Depending on the enable_logging setting. */ public static function can_log() { return wcpay_get_container()->get( InternalLogger::class )->can_log(); } /** * Creates a log entry of type emergency * * @param string $message To send to the log file. * @param array $context Context data. */ public static function emergency( $message, $context = [] ) { self::log( $message, 'emergency', $context ); } /** * Creates a log entry of type alert * * @param string $message To send to the log file. * @param array $context Context data. */ public static function alert( $message, $context = [] ) { self::log( $message, 'alert', $context ); } /** * Creates a log entry of type critical * * @param string $message To send to the log file. * @param array $context Context data. */ public static function critical( $message, $context = [] ) { self::log( $message, 'critical', $context ); } /** * Creates a log entry of type error * * @param string $message To send to the log file. * @param array $context Context data. */ public static function error( $message, $context = [] ) { self::log( $message, 'error', $context ); } /** * Creates a log entry of type warning * * @param string $message To send to the log file. * @param array $context Context data. */ public static function warning( $message, $context = [] ) { self::log( $message, 'warning', $context ); } /** * Creates a log entry of type notice * * @param string $message To send to the log file. * @param array $context Context data. */ public static function notice( $message, $context = [] ) { self::log( $message, 'notice', $context ); } /** * Creates a log entry of type info * * @param string $message To send to the log file. * @param array $context Context data. */ public static function info( $message, $context = [] ) { self::log( $message, 'info', $context ); } /** * Creates a log entry of type debug * * @param string $message To send to the log file. * @param array $context Context data. */ public static function debug( $message, $context = [] ) { self::log( $message, 'debug', $context ); } }