Second Generation Php Logger Extreme 2.0
Leave a Comment so far
Leave a comment
Often times what i’m doing does not require a bloated logger!. So here would be two cool functions to have in your class/script.
// input: array.
// output: The exact same array in your log.out.
function log_a($a)
{
$myFile = "/var/log/sgple20/log.out";
$fh = fopen($myFile, 'a');
fwrite($fh, "\n\n".print_r($a, TRUE).'');
fclose($fh);
}
// Input: A message.
// Output: The same message in your log.out.
function log_m($msg)
{
$myFile = "/var/log/sgple20/log.out";
$fh = fopen($myFile, 'a');
fwrite($fh, "\n".$msg."");
fclose($fh);
}
Leave a Comment
Leave a Comment so far
Leave a comment