Created
March 19, 2013 05:11
-
-
Save jeremejazz/5193855 to your computer and use it in GitHub Desktop.
Class for Error Logging
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class JErrors{ | |
private $filename = ''; | |
/* | |
@param filename | |
*/ | |
function __construct($file) { | |
$this->filename = $file; | |
$filename=$file; | |
} | |
function __destruct() { | |
} | |
/*Display Error Message and Save to Textfile*/ | |
function error_message($message, $file = ''){ | |
if($file == ''){ | |
$file = $this->filename; | |
} | |
$text = date('H:i:s Y-d-m') . ' ' . $message . "\n"; //for error file | |
error_log($message,0); //display to user | |
if($file != ''){ | |
error_log($text,3,$file); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment