diff options
author | Andrey Andreev <narf@devilix.net> | 2019-05-10 19:04:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-10 19:04:57 +0200 |
commit | 30265bcf958337231d032ae1d403493a29379956 (patch) | |
tree | 599f4bca6069cae0e1133eb17074ff812d79eb2e | |
parent | 833d2fda9e9a6379e270384bd30780b148cc6593 (diff) | |
parent | ab658b3ae8799915f3b6ab1cd71a3d4932ffd9d5 (diff) |
Merge pull request #5744 from sharadrsoni/patch-1
Adding support for proper CRLF
-rw-r--r-- | system/core/Log.php | 4 | ||||
-rw-r--r-- | 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 d651e8abe..fde0bebf2 100644 --- a/system/core/Log.php +++ b/system/core/Log.php @@ -249,11 +249,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 ); } } |