diff options
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/Log.pm | 2 | ||||
-rw-r--r-- | FS/FS/Upgrade.pm | 3 | ||||
-rw-r--r-- | FS/FS/log.pm | 47 |
3 files changed, 1 insertions, 51 deletions
diff --git a/FS/FS/Log.pm b/FS/FS/Log.pm index 3facb97df..b11630bc9 100644 --- a/FS/FS/Log.pm +++ b/FS/FS/Log.pm @@ -9,7 +9,7 @@ use vars qw(@STACK @LEVELS); # override the stringification of @_ with something more sensible. BEGIN { - @LEVELS = qw(debug info warning error critical); + @LEVELS = qw(debug info notice warning error critical alert emergency); foreach my $l (@LEVELS) { my $sub = sub { diff --git a/FS/FS/Upgrade.pm b/FS/FS/Upgrade.pm index bbd1ee12b..f26c6a338 100644 --- a/FS/FS/Upgrade.pm +++ b/FS/FS/Upgrade.pm @@ -335,9 +335,6 @@ sub upgrade_data { #fix whitespace - before cust_main 'cust_location' => [], - #remap log levels - 'log' => [], - #cust_main (tokenizes cards, remove paycvv from history, locations, cust_payby, etc) # (handles payinfo encryption/tokenization across all relevant tables) 'cust_main' => [], diff --git a/FS/FS/log.pm b/FS/FS/log.pm index 2543aeaf2..769d6fce1 100644 --- a/FS/FS/log.pm +++ b/FS/FS/log.pm @@ -6,7 +6,6 @@ use FS::Record qw( qsearch qsearchs dbdef ); use FS::UID qw( dbh driver_name ); use FS::log_context; use FS::log_email; -use FS::upgrade_journal; =head1 NAME @@ -382,52 +381,6 @@ sub search { }; } -sub _upgrade_data { - my ($class, %opts) = @_; - - return if FS::upgrade_journal->is_done('log__remap_levels'); - - tie my %levelmap, 'Tie::IxHash', -# 0 => 0, #debug -# 1 => 1, #info - 2 => 1, #notice -> info - 3 => 2, #warning - 4 => 3, #error - 5 => 4, #critical - 6 => 4, #alert -> critical - 7 => 4, #emergency -> critical - ; - - # this method should never autocommit - # should have been set in upgrade, but just in case... - local $FS::UID::AutoCommit = 0; - - # FS::log has no replace method - # in practice, only debug/info/warning/error were used, - # so this should only hit warning/error - foreach my $old (keys %levelmap) { - my $sql = 'UPDATE log SET level=' . dbh->quote($levelmap{$old}) . ' WHERE level=' . dbh->quote($old); - warn $sql unless $opts{'quiet'}; - my $sth = dbh->prepare($sql) or die dbh->errstr; - $sth->execute() or die $sth->errstr; - $sth->finish(); - } - - foreach my $log_email ( - qsearch('log_email',{ 'min_level' => { 'op' => '>=', 'value' => '2' } }) - ) { - $log_email->min_level($levelmap{$log_email->min_level}); - my $error = $log_email->replace; - if ($error) { - dbh->rollback; - die $error; - } - } - - FS::upgrade_journal->set_done('log__remap_levels'); - -} - =back =head1 BUGS |