Commit bb17a3a4 by irul

change new line with php_eol

1 parent 5a531db3
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
* *
* @author * @author
* https://findnerd.com/list/view/Logger-class-in-PHP/1852/ * https://findnerd.com/list/view/Logger-class-in-PHP/1852/
*
* adjustment by irul @ 20240831
*/ */
define("DATESTRING_FULL", "Y-m-d H:i:s"); define("DATESTRING_FULL", "Y-m-d H:i:s");
...@@ -83,7 +85,7 @@ class Logger ...@@ -83,7 +85,7 @@ class Logger
* */ * */
public function log($string) public function log($string)
{ {
$this->do_write("\n" . date(DATESTRING_FULL) . ' - ' . $string); $this->do_write(date(DATESTRING_FULL) . ' - ' . $string . PHP_EOL);
} }
/* /*
...@@ -97,7 +99,7 @@ class Logger ...@@ -97,7 +99,7 @@ class Logger
* */ * */
public function dump($var_name, $string = '') public function dump($var_name, $string = '')
{ {
$this->do_write("\n" . date(DATESTRING_FULL) . (empty($string) ? ' - VARDUMP ' : ' - Dump of ') . $string . ' => ' . var_export($var_name, true)); $this->do_write(date(DATESTRING_FULL) . (empty($string) ? ' - VARDUMP ' : ' - Dump of ') . $string . ' => ' . var_export($var_name, true) . PHP_EOL);
} }
/* /*
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!