diff --git a/php/logging.php b/php/logging.php new file mode 100644 index 0000000..0edd625 --- /dev/null +++ b/php/logging.php @@ -0,0 +1,29 @@ +"; + return; + } + + $handle = fopen(LOG_FILE, "a"); + if (!$handle) { + echo "Unable to open file.
"; + return; + } + + if (!fwrite($handle, $string . "\n")) { + echo "Unable to write to file.
"; + } + fclose($handle); +} + +function log_error($string) +{ + log_print(PREFIX_ERROR . $string); +} +?>