Virus In Training


Second Generation Php Logger Extreme 2.0 by mozey
June 9, 2008, 2:56 am
Filed under: blog | Tags: , ,

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);
}

About these ads

Leave a Comment so far
Leave a comment



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s



Follow

Get every new post delivered to your Inbox.

%d bloggers like this: