Skip to content

Commit

Permalink
Use windows line feeds when logging to error log on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
mantis committed Dec 18, 2008
1 parent 4b97503 commit c3a2fb6
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions core/logging_api.php
Expand Up @@ -63,11 +63,19 @@ function log_event( $p_level, $p_msg ) {

switch( $t_destination ) {
case 'file':
error_log( $t_php_event . "\n", 3, $t_modifiers );
if( 'WIN' == substr( PHP_OS, 0, 3 ) ) {
error_log( $t_php_event . "\r\n", 3, $t_modifiers );
} else {
error_log( $t_php_event . "\n", 3, $t_modifiers );
}
break;
default:
# use default PHP error log settings
error_log( $t_php_event . "\n" );
if( 'WIN' == substr( PHP_OS, 0, 3 ) ) {
error_log( $t_php_event . "\r\n" );
} else {
error_log( $t_php_event . "\n" );
}
break;
}
}

0 comments on commit c3a2fb6

Please sign in to comment.