Created
December 10, 2020 20:25
-
-
Save erwstout/b7202c1b06dd9017b0b33e53f1419aa6 to your computer and use it in GitHub Desktop.
WordPress Logger
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!function_exists('log_it')) { | |
function log_it($message) | |
{ | |
if (WP_DEBUG === true) { | |
if (is_array($message) || is_object($message)) { | |
error_log(print_r($message, true)); | |
} else { | |
error_log($message); | |
} | |
} | |
} | |
} | |
// wp config options | |
// debug stuff for plugin dev | |
@ini_set('display_errors',0); | |
define( 'WP_DEBUG', true ); // Turn debugging ON | |
define( 'WP_DEBUG_DISPLAY', false ); // Turn forced display OFF | |
define( 'WP_DEBUG_LOG', true ); // Turn logging to wp-content/debug.log ON | |
define( 'WP_POST_REVISIONS', false); // Disables revision functionality |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment