From b0f43e29e43228366390de7e0aa80d2134d1f224 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 10 May 2019 20:04:57 +0300 Subject: Merge pull request #5744 from sharadrsoni/patch-1 Adding support for proper CRLF --- system/core/Log.php | 4 ++-- tests/codeigniter/core/Log_test.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/system/core/Log.php b/system/core/Log.php index 4338aa939..f37726e02 100644 --- a/system/core/Log.php +++ b/system/core/Log.php @@ -247,11 +247,11 @@ class CI_Log { * @param string $level The error level * @param string $date Formatted date string * @param string $message The log message - * @return string Formatted log line with a new line character '\n' at the end + * @return string Formatted log line with a new line character at the end */ protected function _format_line($level, $date, $message) { - return $level.' - '.$date.' --> '.$message."\n"; + return $level.' - '.$date.' --> '.$message.PHP_EOL; } // -------------------------------------------------------------------- diff --git a/tests/codeigniter/core/Log_test.php b/tests/codeigniter/core/Log_test.php index 103af342b..927984385 100644 --- a/tests/codeigniter/core/Log_test.php +++ b/tests/codeigniter/core/Log_test.php @@ -57,7 +57,7 @@ class Log_test extends CI_TestCase { $format_line->setAccessible(TRUE); $this->assertEquals( $format_line->invoke($instance, 'LEVEL', 'Timestamp', 'Message'), - "LEVEL - Timestamp --> Message\n" + "LEVEL - Timestamp --> Message".PHP_EOL ); } } -- cgit v1.2.3-24-g4f1b