fn_log

Log errors from Saferpay.

Description

(string) fn_log( $message, (int) $orderid = 0, (constant) $clean = false ); 

Returns (string)

- returns the content of the response from Saferpay

Parameters (3)

0. $message
The message.
1. $orderid — Optional. (int)
The orderid.
2. $clean — Optional. (constant) => false
The clean.

Usage

  1. if ( !function_exists( 'fn_log' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-payment-gateway-for-saferpay/fn-saferpay.php'; 
  3.  
  4. // The message. 
  5. $message = null; 
  6.  
  7. // The orderid. 
  8. $orderid = -1; 
  9.  
  10. // The clean. 
  11. $clean = false; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = fn_log($message, $orderid, $clean); 
  15.  

Defined (1)

The function is defined in the following location(s).

/fn-saferpay.php  
  1. function fn_log($message, $orderid = 0, $clean = false) 
  2.  
  3. $file = plugin_dir_path( __FILE__ ) . "errors/" . $orderid . ".log"; 
  4.  
  5. if($clean && $orderid != 0) 
  6. unlink($file); 
  7.  
  8. error_log($message, 3, $file); 
  9.