Created
September 24, 2018 16:49
-
-
Save DevWael/b23ff303f157233053bccdc18431acc5 to your computer and use it in GitHub Desktop.
function to create log file to test data in backend (Development Purposes Only)
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
<?php | |
function dev_log( $log_data ) { | |
$log_file_name = "log"; | |
if ( ! file_exists( $log_file_name ) ) { | |
mkdir( $log_file_name, 0777, true ); | |
} | |
$log_file_data = $log_file_name . '/log_' . date( 'd-M-Y' ) . '.log'; | |
file_put_contents( $log_file_data, $log_data . "\n", FILE_APPEND ); | |
} | |
//For wordpress developers: put this function into your plugin or theme (functions.php) and call it to test your data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment