[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb: [910] trunk/LedgerSMB/Log.pm



Revision: 910
          http://svn.sourceforge.net/ledger-smb/?rev=910&view=rev
Author:   linuxpoet
Date:     2007-03-14 22:59:07 -0700 (Wed, 14 Mar 2007)

Log Message:
-----------
Modified to use STDERR if logging is turned on. Still to do, make actual logging different. Specifically allow logging to STDERR or a file.

Modified Paths:
--------------
    trunk/LedgerSMB/Log.pm

Modified: trunk/LedgerSMB/Log.pm
===================================================================
--- trunk/LedgerSMB/Log.pm	2007-03-15 05:22:32 UTC (rev 909)
+++ trunk/LedgerSMB/Log.pm	2007-03-15 05:59:07 UTC (rev 910)
@@ -13,6 +13,7 @@
 
 Available methods: (in order, most to least severe)
 
+
 =over 4
 
 =item emerg
@@ -53,28 +54,16 @@
 
 our $VERSION = '1.0.0';
 
-our $fh;
+our $log_line;
 
 sub print { 
 	if (!$LedgerSMB::Sysconfig::logging){
 		return 0;
 	}
 	shift;
-	unless($fh) { 
-		# TODO: this is grosly wrong, but so is this module in the first place.
-		# the log messages *should* end up in the apache log, but that will
-		# hopefully be corrected in the future.
+ 	$log_line = sprintf('[%s] [%s] %i %s', scalar(localtime), +shift, $$, join(' ',@_))."\n";
+	print STDERR $log_line;
 
-		$fh=IO::File->new('>>users/ledger-smb.log');
-		$fh->autoflush(1);
-		__PACKAGE__->print('general',"Log file opened");
-	}
-
-	$fh->print(sprintf('[%s] [%s] %i %s',
-				scalar(localtime),
-				+shift,
-				$$,
-				join(' ',@_))."\n");
 }
 
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.