gde_dx_log

GDE Extended Logging.

Description

gde_dx_log( $text ); 

Parameters (1)

0. $text
The text.

Usage

  1. if ( !function_exists( 'gde_dx_log' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-doc-embedder/functions.php'; 
  3.  
  4. // The text. 
  5. $text = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = gde_dx_log($text); 
  9.  

Defined (1)

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

/functions.php  
  1. function gde_dx_log( $text ) { 
  2. global $gdeoptions, $wpdb; 
  3.  
  4. if ( GDE_DX_LOGGING > 0 || ( isset( $gdeoptions['error_log'] ) && $gdeoptions['error_log'] == "yes" ) ) { 
  5. // filter to trap any "unexpected output" to log 
  6. add_action( 'activated_plugin', 'gde_save_error' ); 
  7.  
  8. $table = $wpdb->base_prefix . 'gde_dx_log'; 
  9.  
  10. // create/update table if necessary, then write to log 
  11. if ( gde_dx_log_create() ) { 
  12. // write to log 
  13. $blogid = get_current_blog_id(); 
  14. $text = date( "d-m-Y, H:i:s" ) . " - $text"; 
  15.  
  16. if ( ! $wpdb->insert( 
  17. $table,  
  18. array( 
  19. 'blogid' => $blogid,  
  20. 'data' => $text 
  21. ),  
  22. array( 
  23. '%d', '%s' 
  24. ) ) { 
  25. // couldn't write to db 
  26. return false; 
  27. } else { 
  28. return true; 
  29. } else { 
  30. // can't create db table 
  31. return false; 
  32. } else { 
  33. // logging disabled 
  34. return false;