commit 118a1b933ba4c7a821b602810c97fc86f4fcaeb1 parent 27c625b53d3e9361fa2edc77332f309e0dd9d6a2 Author: William Lindholm <william_lindholm@outlook.com> Date: Wed, 27 Sep 2023 18:19:33 +0000 Logging to file instead of using JS console log. Diffstat:
| M | logging.php | | | 14 | +++----------- |
1 file changed, 3 insertions(+), 11 deletions(-)
diff --git a/logging.php b/logging.php @@ -1,15 +1,7 @@ <?php function logg($message) { - global $console_logs; - $console_logs[] = $message; - } - - function outputConsoleLogs() { - global $console_logs; - echo '<script>'; - foreach ($console_logs as $msg) { - echo "console.log(" . json_encode($msg) . ");"; - } - echo '</script>'; + $timestamp = date("Y-m-d H:i:s"); + $logMessage = "{$timestamp} - {$message}\n"; + file_put_contents('logs.txt', $logMessage, FILE_APPEND); } ?> \ No newline at end of file