LogWrite() - Simple Logging Function


Code
sub LogWrite {
    # Purpose
    #   Used to make an entry in the log specified by the global LogFilespec.
    # Parameters
    #   1 Msg (String) = The message we want to write to the log.
    # Globals
    #   LogFilespec (String) = The filespec of the log file we're working with.

    my $Msg = shift @_;

    # Set the delimimter used in log files
    my $Delimiter = ' | ';

    $TS = &GetTimeStamp;                    # Get a timestamp
    $Entry = $TS . $Delimiter . $Msg;       # Build the log entry with leading timestamp

    open (LOGFILE, ">>$LogFilespec");
    print LOGFILE "\n$Entry";
    close (LOGFILE);

}


The Captian
Today they call you "crazy". Tomorrow they call you "ahead of your time."
Global Skywatch Learn about Chemtrails - You're breathing them now!
OnlyTheBestHerbs.com World-class supplements
Mercury Talk Why you are sick.
OneUp Domains Domains, Hosting, Email
1-800-358-4278 (U.S. & Canada)