Last active
November 1, 2016 20:41
-
-
Save badfun/666cd22bd11e7d9dd88a9002d1b9ba08 to your computer and use it in GitHub Desktop.
Revisions
-
badfun renamed this gist
Nov 1, 2016 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,4 @@ <?php /** * Simple debug logger * -
badfun created this gist
Nov 1, 2016 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ /** * Simple debug logger * * @param $data */ function ctrial_write_debug_log( $data ) { $debug_file = 'debug.txt'; // if file already exists append data if ( is_writeable( $debug_file ) ) { $handle = fopen( $debug_file, 'a' ); $new_data = "\n" . implode( " ", $data ); fwrite( $handle, $new_data ); } else { $handle = fopen( $debug_file, 'w' ); fwrite( $handle, implode( " ", $data ) ); } fclose( $handle ); }