Skip to content

Instantly share code, notes, and snippets.

@bahiirwa
Created February 21, 2022 08:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bahiirwa/ef98576b5955e25df6feaae4404bfcc8 to your computer and use it in GitHub Desktop.
Save bahiirwa/ef98576b5955e25df6feaae4404bfcc8 to your computer and use it in GitHub Desktop.
Write Error Log Function
<?php
/**
* Plugin Name: TechiePress Write Error Log Function
*/
if (!function_exists('write_log')) {
function write_log ( $log ) {
if ( true === WP_DEBUG ) {
if ( is_array( $log ) || is_object( $log ) ) {
error_log( print_r( $log, true ) );
} else {
error_log( $log );
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment