[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb:[4405] trunk
- Subject: SF.net SVN: ledger-smb:[4405] trunk
- From: ..hidden..
- Date: Wed, 07 Mar 2012 14:29:25 +0000
Revision: 4405
http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4405&view=rev
Author: einhverfr
Date: 2012-03-07 14:29:24 +0000 (Wed, 07 Mar 2012)
Log Message:
-----------
Removing old largely unused log framework
Modified Paths:
--------------
trunk/LedgerSMB/AA.pm
trunk/LedgerSMB/AM.pm
trunk/LedgerSMB/Auth/DB.pm
trunk/LedgerSMB/DBObject/Admin.pm
trunk/LedgerSMB/DBObject.pm
trunk/LedgerSMB/DBObject_Moose.pm
trunk/LedgerSMB/Database.pm
trunk/LedgerSMB/Form.pm
trunk/LedgerSMB/IC.pm
trunk/LedgerSMB/OE.pm
trunk/LedgerSMB/RP.pm
trunk/LedgerSMB/ScriptLib/Company.pm
trunk/LedgerSMB/Scripts/account.pm
trunk/LedgerSMB/Scripts/admin.pm
trunk/LedgerSMB/Session.pm
trunk/LedgerSMB/Template.pm
trunk/LedgerSMB/User.pm
trunk/LedgerSMB.pm
trunk/lsmb-request.pl
trunk/t/01-load.t
Removed Paths:
-------------
trunk/LedgerSMB/Log.pm
trunk/t/13-log.t
Modified: trunk/LedgerSMB/AA.pm
===================================================================
--- trunk/LedgerSMB/AA.pm 2012-03-07 12:49:46 UTC (rev 4404)
+++ trunk/LedgerSMB/AA.pm 2012-03-07 14:29:24 UTC (rev 4405)
@@ -28,7 +28,7 @@
package AA;
use LedgerSMB::Sysconfig;
-use LedgerSMB::Log;
+use Log::Log4perl;
use LedgerSMB::File;
use Math::BigFloat;
Modified: trunk/LedgerSMB/AM.pm
===================================================================
--- trunk/LedgerSMB/AM.pm 2012-03-07 12:49:46 UTC (rev 4404)
+++ trunk/LedgerSMB/AM.pm 2012-03-07 14:29:24 UTC (rev 4405)
@@ -55,6 +55,7 @@
package AM;
use LedgerSMB::Tax;
use LedgerSMB::Sysconfig;
+use Log::Log4perl;
my $logger = Log::Log4perl->get_logger('AM');
Modified: trunk/LedgerSMB/Auth/DB.pm
===================================================================
--- trunk/LedgerSMB/Auth/DB.pm 2012-03-07 12:49:46 UTC (rev 4404)
+++ trunk/LedgerSMB/Auth/DB.pm 2012-03-07 14:29:24 UTC (rev 4405)
@@ -19,7 +19,7 @@
package LedgerSMB::Auth;
use MIME::Base64;
use LedgerSMB::Sysconfig;
-use LedgerSMB::Log;
+use Log::Log4perl;
use strict;
my $logger = Log::Log4perl->get_logger('LedgerSMB::Auth');
Modified: trunk/LedgerSMB/DBObject/Admin.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Admin.pm 2012-03-07 12:49:46 UTC (rev 4404)
+++ trunk/LedgerSMB/DBObject/Admin.pm 2012-03-07 14:29:24 UTC (rev 4405)
@@ -33,7 +33,7 @@
use LedgerSMB::Contact;
use LedgerSMB::DBObject::Employee;
use LedgerSMB::DBObject::User;
-use LedgerSMB::Log;
+use Log::Log4perl;
use strict;
my $logger = Log::Log4perl->get_logger("LedgerSMB::DBObject::Admin");
Modified: trunk/LedgerSMB/DBObject.pm
===================================================================
--- trunk/LedgerSMB/DBObject.pm 2012-03-07 12:49:46 UTC (rev 4404)
+++ trunk/LedgerSMB/DBObject.pm 2012-03-07 14:29:24 UTC (rev 4405)
@@ -48,7 +48,7 @@
package LedgerSMB::DBObject;
use Scalar::Util;
use base qw(LedgerSMB);
-use LedgerSMB::Log;
+use Log::Log4perl;
use strict;
use warnings;
Modified: trunk/LedgerSMB/DBObject_Moose.pm
===================================================================
--- trunk/LedgerSMB/DBObject_Moose.pm 2012-03-07 12:49:46 UTC (rev 4404)
+++ trunk/LedgerSMB/DBObject_Moose.pm 2012-03-07 14:29:24 UTC (rev 4405)
@@ -48,7 +48,7 @@
package LedgerSMB::DBObject_Moose;
use Moose;
use Scalar::Util;
-use LedgerSMB::Log;
+use Log::Log4perl;
has 'dbh' => (is => 'ro', isa => 'DBI::db', required => '1');
has '_roles' => (is => 'ro', isa => 'ArrayRef[Str]', required => '1');
Modified: trunk/LedgerSMB/Database.pm
===================================================================
--- trunk/LedgerSMB/Database.pm 2012-03-07 12:49:46 UTC (rev 4404)
+++ trunk/LedgerSMB/Database.pm 2012-03-07 14:29:24 UTC (rev 4405)
@@ -28,6 +28,7 @@
use LedgerSMB::Sysconfig;
use base('LedgerSMB');
use strict;
+use Log::Log4perl;
Log::Log4perl::init(\$LedgerSMB::Sysconfig::log4perl_config);
my $logger = Log::Log4perl->get_logger('');
Modified: trunk/LedgerSMB/Form.pm
===================================================================
--- trunk/LedgerSMB/Form.pm 2012-03-07 12:49:46 UTC (rev 4404)
+++ trunk/LedgerSMB/Form.pm 2012-03-07 14:29:24 UTC (rev 4405)
@@ -66,13 +66,13 @@
use File::Copy;
use LedgerSMB::Company_Config;
use LedgerSMB::PGNumber;
+use Log::Log4perl;
use charnames qw(:full);
use open ':utf8';
package Form;
use utf8;
-use LedgerSMB::Log;
our $logger = Log::Log4perl->get_logger('LedgerSMB::Form');
=item new Form([$argstr])
Modified: trunk/LedgerSMB/IC.pm
===================================================================
--- trunk/LedgerSMB/IC.pm 2012-03-07 12:49:46 UTC (rev 4404)
+++ trunk/LedgerSMB/IC.pm 2012-03-07 14:29:24 UTC (rev 4405)
@@ -33,7 +33,7 @@
package IC;
-use LedgerSMB::Log;
+use Log::Log4perl;
use LedgerSMB::File;
my $logger = Log::Log4perl->get_logger('IC');
Deleted: trunk/LedgerSMB/Log.pm
===================================================================
--- trunk/LedgerSMB/Log.pm 2012-03-07 12:49:46 UTC (rev 4404)
+++ trunk/LedgerSMB/Log.pm 2012-03-07 14:29:24 UTC (rev 4405)
@@ -1,101 +0,0 @@
-
-=head1 NAME
-
-LedgerSMB::Log - LedgerSMB logging and debugging framework
-
-=head1 SYOPSIS
-
-This module maintains a connection to the LedgerSMB log file
-(Seperate from the apche error log, for now)
-
-=head1 METHODS
-
-This module is loosly based on Apache::Log.
-
-Available methods: (in order, most to least severe)
-
-
-=over 4
-
-=item emerg
-
-=item alert
-
-=item crit
-
-=item error
-
-=item warn
-
-=item notice
-
-=item info
-
-=item debug
-
-=item longmess
-
-This uses Carp to make a debug message with the full stack backtrace, including function arguments, where Carp can infer them.
-
-=item dump
-
-This uses Data::Dumper to dump the contents of a data structure as a debug message.
-
-=item print
-
-Uses sprintf to format a log line with a timestamp and a message.
-
-=back
-
-=cut
-
-package LedgerSMB::Log;
-use strict;
-use warnings;
-use IO::File;
-use Data::Dumper;
-use LedgerSMB::Sysconfig;
-use Carp ();
-use Log::Log4perl;
-
-Log::Log4perl::init(\$LedgerSMB::Sysconfig::log4perl_config);
-
-my $logger = Log::Log4perl->get_logger('');
-$logger->debug('LedgerSMB::Log Log4perl config: ', $LedgerSMB::Sysconfig::log4perl_config);
-
-our $VERSION = '1.0.0';
-
-our $log_line;
-
-sub print {
- if ( !$LedgerSMB::Sysconfig::logging ) {
- return 0;
- }
- shift;
- my $level = shift;
- $log_line = sprintf( '[%s] [%s] %i %s',
- scalar(localtime), +shift, $$, join( ' ', @_ ) )
- . "\n";
- $logger->$level($log_line);
-
-}
-
-sub emerg { shift->print( 'emerg', @_ ) }
-sub alert { shift->print( 'alert', @_ ) }
-sub crit { shift->print( 'crit', @_ ) }
-sub error { shift->print( 'error', @_ ) }
-sub warn { shift->print( 'warn', @_ ) }
-sub notice { shift->print( 'notice', @_ ) }
-sub info { shift->print( 'info', @_ ) }
-sub debug { shift->print( 'debug', @_ ) }
-
-sub longmess { shift->print( 'debug', Carp::longmess(@_) ) }
-
-sub dump {
- my $self = shift;
- my $d = Data::Dumper->new( ..hidden.. );
- $d->Sortkeys(1);
- $self->print( 'debug', $d->Dump() );
-}
-
-1;
Modified: trunk/LedgerSMB/OE.pm
===================================================================
--- trunk/LedgerSMB/OE.pm 2012-03-07 12:49:46 UTC (rev 4404)
+++ trunk/LedgerSMB/OE.pm 2012-03-07 14:29:24 UTC (rev 4405)
@@ -35,6 +35,7 @@
package OE;
use LedgerSMB::Tax;
use LedgerSMB::Sysconfig;
+use Log::Log4perl;
my $logger = Log::Log4perl->get_logger('OE');
=over
Modified: trunk/LedgerSMB/RP.pm
===================================================================
--- trunk/LedgerSMB/RP.pm 2012-03-07 12:49:46 UTC (rev 4404)
+++ trunk/LedgerSMB/RP.pm 2012-03-07 14:29:24 UTC (rev 4405)
@@ -32,7 +32,7 @@
#======================================================================
package RP;
-use LedgerSMB::Log;
+use Log::Log4perl;
our $logger = Log::Log4perl->get_logger('LedgerSMB::Form');
sub inventory_activity {
Modified: trunk/LedgerSMB/ScriptLib/Company.pm
===================================================================
--- trunk/LedgerSMB/ScriptLib/Company.pm 2012-03-07 12:49:46 UTC (rev 4404)
+++ trunk/LedgerSMB/ScriptLib/Company.pm 2012-03-07 14:29:24 UTC (rev 4405)
@@ -2,7 +2,7 @@
use LedgerSMB::Template;
use LedgerSMB::DBObject::Customer;
use LedgerSMB::DBObject::Vendor;
-use LedgerSMB::Log;
+use Log::Log4perl;
my $logger = Log::Log4perl->get_logger("LedgerSMB::ScriptLib::Company");
Modified: trunk/LedgerSMB/Scripts/account.pm
===================================================================
--- trunk/LedgerSMB/Scripts/account.pm 2012-03-07 12:49:46 UTC (rev 4404)
+++ trunk/LedgerSMB/Scripts/account.pm 2012-03-07 14:29:24 UTC (rev 4405)
@@ -1,7 +1,7 @@
use Template;
use LedgerSMB::DBObject::Account;
package LedgerSMB::Scripts::account;
-use LedgerSMB::Log;
+use Log::Log4perl;
use Data::Dumper;
use strict;
Modified: trunk/LedgerSMB/Scripts/admin.pm
===================================================================
--- trunk/LedgerSMB/Scripts/admin.pm 2012-03-07 12:49:46 UTC (rev 4404)
+++ trunk/LedgerSMB/Scripts/admin.pm 2012-03-07 14:29:24 UTC (rev 4405)
@@ -24,7 +24,7 @@
use LedgerSMB::DBObject::User;
use Data::Dumper;
use LedgerSMB::Setting;
-use LedgerSMB::Log;
+use Log::Log4perl;
# I don't really like the code in this module. The callbacks are per form which
# means there is no semantic difference between different buttons that can be
Modified: trunk/LedgerSMB/Session.pm
===================================================================
--- trunk/LedgerSMB/Session.pm 2012-03-07 12:49:46 UTC (rev 4404)
+++ trunk/LedgerSMB/Session.pm 2012-03-07 14:29:24 UTC (rev 4405)
@@ -16,7 +16,7 @@
package LedgerSMB::Session;
use LedgerSMB::Sysconfig;
-use LedgerSMB::Log;
+use Log::Log4perl;
use strict;
my $logger = Log::Log4perl->get_logger('LedgerSMB');
Modified: trunk/LedgerSMB/Template.pm
===================================================================
--- trunk/LedgerSMB/Template.pm 2012-03-07 12:49:46 UTC (rev 4404)
+++ trunk/LedgerSMB/Template.pm 2012-03-07 14:29:24 UTC (rev 4405)
@@ -139,6 +139,7 @@
use LedgerSMB::Mailer;
use LedgerSMB::Company_Config;
use LedgerSMB::Locale;
+use Log::Log4perl;
my $logger = Log::Log4perl->get_logger('LedgerSMB::Template');
Modified: trunk/LedgerSMB/User.pm
===================================================================
--- trunk/LedgerSMB/User.pm 2012-03-07 12:49:46 UTC (rev 4404)
+++ trunk/LedgerSMB/User.pm 2012-03-07 14:29:24 UTC (rev 4405)
@@ -59,6 +59,7 @@
use LedgerSMB::Sysconfig;
use LedgerSMB::Auth;
use Data::Dumper;
+use Log::Log4perl;
my $logger = Log::Log4perl->get_logger('LedgerSMB::User');
Modified: trunk/LedgerSMB.pm
===================================================================
--- trunk/LedgerSMB.pm 2012-03-07 12:49:46 UTC (rev 4404)
+++ trunk/LedgerSMB.pm 2012-03-07 14:29:24 UTC (rev 4405)
@@ -215,7 +215,6 @@
use LedgerSMB::Locale;
use LedgerSMB::User;
use LedgerSMB::Setting;
-use LedgerSMB::Log;
use LedgerSMB::Company_Config;
use strict;
use utf8;
Modified: trunk/lsmb-request.pl
===================================================================
--- trunk/lsmb-request.pl 2012-03-07 12:49:46 UTC (rev 4404)
+++ trunk/lsmb-request.pl 2012-03-07 14:29:24 UTC (rev 4405)
@@ -33,7 +33,7 @@
use LedgerSMB;
use LedgerSMB::Locale;
use Data::Dumper;
-use LedgerSMB::Log;
+use Log::Log4perl;
use LedgerSMB::CancelFurtherProcessing;
use strict;
Modified: trunk/t/01-load.t
===================================================================
--- trunk/t/01-load.t 2012-03-07 12:49:46 UTC (rev 4404)
+++ trunk/t/01-load.t 2012-03-07 14:29:24 UTC (rev 4405)
@@ -2,7 +2,7 @@
use strict;
use warnings;
-use Test::More tests => 55;
+use Test::More tests => 54;
use_ok('LedgerSMB::Sysconfig')
|| BAIL_OUT('System Configuration could be loaded!');
@@ -36,7 +36,6 @@
use_ok('LedgerSMB::IS');
use_ok('LedgerSMB::JC');
use_ok('LedgerSMB::Locale');
-use_ok('LedgerSMB::Log');
use_ok('LedgerSMB::Mailer');
use_ok('LedgerSMB::Num2text');
use_ok('LedgerSMB::OE');
Deleted: trunk/t/13-log.t
===================================================================
--- trunk/t/13-log.t 2012-03-07 12:49:46 UTC (rev 4404)
+++ trunk/t/13-log.t 2012-03-07 14:29:24 UTC (rev 4405)
@@ -1,61 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-
-$ENV{TMPDIR} = 't/var';
-
-#use Test::More tests => 13;
-use Test::More;
-plan skip_all => 'Disabled because we have moved to Log4perl and the predefined
-methods in the LedgerSMB::Log package nto currently recommended';
-use Test::Trap qw(trap $trap);
-
-use Data::Dumper;
-
-use LedgerSMB::Sysconfig;
-use LedgerSMB::Log;
-
-my @r;
-
-$LedgerSMB::Sysconfig::logging = 0;
..hidden.. = trap{LedgerSMB::Log->print('test', 'message')};
-#is(LedgerSMB::Log->print('test', 'message'), 0);
-ok(!$trap->stderr,
- 'print: Unsetting LedgerSMB::Sysconfig::logging disables printing');
-$LedgerSMB::Sysconfig::logging = 1;
..hidden.. = trap{LedgerSMB::Log->print('test', 'message')};
-ok($trap->stderr,
- 'print: Setting LedgerSMB::Sysconfig::logging enables printing');
-like($trap->stderr, qr/^\[.*?\] \[test\] $$ message/,
- 'print: Outputs correct message');
..hidden.. = trap{LedgerSMB::Log->emerg('test')};
-like($trap->stderr, qr/^\[.*?\] \[emerg\] $$ test/,
- 'emerg: Outputs correct grouping');
..hidden.. = trap{LedgerSMB::Log->alert('test')};
-like($trap->stderr, qr/^\[.*?\] \[alert\] $$ test/,
- 'alert: Outputs correct grouping');
..hidden.. = trap{LedgerSMB::Log->crit('test')};
-like($trap->stderr, qr/^\[.*?\] \[crit\] $$ test/,
- 'crit: Outputs correct grouping');
..hidden.. = trap{LedgerSMB::Log->error('test')};
-like($trap->stderr, qr/^\[.*?\] \[error\] $$ test/,
- 'error: Outputs correct grouping');
..hidden.. = trap{LedgerSMB::Log->warn('test')};
-like($trap->stderr, qr/^\[.*?\] \[warn\] $$ test/,
- 'warn: Outputs correct grouping');
..hidden.. = trap{LedgerSMB::Log->notice('test')};
-like($trap->stderr, qr/^\[.*?\] \[notice\] $$ test/,
- 'notice: Outputs correct grouping');
..hidden.. = trap{LedgerSMB::Log->info('test')};
-like($trap->stderr, qr/^\[.*?\] \[info\] $$ test/,
- 'info: Outputs correct grouping');
..hidden.. = trap{LedgerSMB::Log->debug('test')};
-like($trap->stderr, qr/^\[.*?\] \[debug\] $$ test/,
- 'debug: Outputs correct grouping');
..hidden.. = trap{LedgerSMB::Log->dump('test')};
-like($trap->stderr, qr/^\[.*?\] \[debug\] $$ \$VAR1 = 'test'/,
- 'dump: Simple dump correct');
..hidden.. = trap{LedgerSMB::Log->longmess('test')};
-like($trap->stderr, qr/^\[.*?\] \[debug\] $$ test at /,
- 'longmess: Outputs correct data');
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.