Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Enable logging function

rmnl edited this page Mar 22, 2016 · 1 revision

To enable the jwplayer_log function replace the following code:

function jwplayer_log( $line, $print_r = false ) {
 // Due to Wordpress VIP requirements this function is just a stub.
 // If you want to make it work, visit and copy the code that makes this
 // function work.
 return;
}

with this code:

function jwplayer_log( $line, $print_r = false ) {
 if (WP_DEBUG) {
 $msg = ( $print_r ) ? print_r( $msg, true ): $msg;
 $upload_dir = wp_upload_dir();
 $log_file = $upload_dir['basedir'] . '/.jw-player.log';
 if ( ! file_exists( $log_file ) ) {
 touch( $log_file );
 }
 $prefix = '[' . date( 'H:i:s' ) . '] ';
 $msg = $prefix . str_replace( "\n", "\n" . $prefix, $msg ) . "\n";
 file_put_contents( $log_file, $msg, $flags = FILE_APPEND );
 }
}

Clone this wiki locally

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /