WC_Gateway_Paypal::log
Logging method.
Method of the class: WC_Gateway_Paypal{}
No Hooks.
Returns
null. Nothing (null).
Usage
$result = WC_Gateway_Paypal::log( $message, $level );
- $message(string) (required)
- Log message.
- $level(string)
- Possible values: emergency|alert|critical|error|warning|notice|info|debug.
Default:'info'
WC_Gateway_Paypal::log() WC Gateway Paypal::log code WC 10.5.0
public static function log( $message, $level = 'info' ) {
if ( is_null( self::$log_enabled ) ) {
$settings = get_option( 'woocommerce_paypal_settings' );
self::$log_enabled = 'yes' === ( $settings['debug'] ?? 'no' );
}
if ( self::$log_enabled ) {
if ( empty( self::$log ) ) {
self::$log = wc_get_logger();
}
self::$log->log( $level, $message, array( 'source' => self::ID ) );
}
}