Log.class.inc 885 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /*
  3. * DON'T REMOVE THE FOLLOWING LICENSE
  4. * INFORMATION!
  5. * ----------------------------------
  6. * Copyright by
  7. * Dennis Ritz
  8. * Author: Dennis Ritz
  9. * dennis.ritz@gmx.net
  10. * 2007-2008
  11. * ----------------------------------
  12. */
  13. class Log {
  14. public function __construct() {
  15. }
  16. private static function _writeToLogFile($p_msg) {
  17. $myFile = ROOT_DIR."/errorLog.txt";
  18. $fh = fopen($myFile, 'a');
  19. fwrite($fh, $p_msg);
  20. $stringData = "";
  21. fwrite($fh, $stringData."\r\n");
  22. fclose($fh);
  23. }
  24. public static function notice($p_file,$p_line,$p_msg) {
  25. self::_writeToLogFile("NOTICE [$p_file:$p_line] ".$p_msg);
  26. }
  27. public static function warning($p_file,$p_line,$p_msg) {
  28. self::_writeToLogFile("WARNING [$p_file:$p_line] ".$p_msg);
  29. }
  30. public static function error($p_file,$p_line,$p_msg) {
  31. self::_writeToLogFile("ERROR [$p_file:$p_line] ".$p_msg);
  32. }
  33. }
  34. ?>