gde_dx_log
GDE Extended Logging.
Description
gde_dx_log( $text );
Parameters (1)
- 0. $text
- The text.
Usage
if ( !function_exists( 'gde_dx_log' ) ) { require_once ABSPATH . PLUGINDIR . 'google-doc-embedder/functions.php'; } // The text. $text = null; // NOTICE! Understand what this does before running. $result = gde_dx_log($text);
Defined (1)
The function is defined in the following location(s).
- /functions.php
- function gde_dx_log( $text ) {
- global $gdeoptions, $wpdb;
- if ( GDE_DX_LOGGING > 0 || ( isset( $gdeoptions['error_log'] ) && $gdeoptions['error_log'] == "yes" ) ) {
- // filter to trap any "unexpected output" to log
- add_action( 'activated_plugin', 'gde_save_error' );
- $table = $wpdb->base_prefix . 'gde_dx_log';
- // create/update table if necessary, then write to log
- if ( gde_dx_log_create() ) {
- // write to log
- $blogid = get_current_blog_id();
- $text = date( "d-m-Y, H:i:s" ) . " - $text";
- if ( ! $wpdb->insert(
- $table,
- array(
- 'blogid' => $blogid,
- 'data' => $text
- ),
- array(
- '%d', '%s'
- )
- ) ) {
- // couldn't write to db
- return false;
- } else {
- return true;
- }
- } else {
- // can't create db table
- return false;
- }
- } else {
- // logging disabled
- return false;
- }
- }