Changeset 1698


Ignore:
Timestamp:
02/02/16 05:44:36 (8 years ago)
Author:
nanardon
Message:

Trap empty log message, fix empty log message

Location:
trunk/LATMOS-Accounts/lib/LATMOS/Accounts
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Objects.pm

    r1595 r1698  
    605605        foreach my $field (keys %parsed_filter) { 
    606606            $base->attribute($class->type, $field) or 
    607                 la_log LA_WARN "Unsupported attribute $field"; 
     607                la_log(LA_WARN, "Unsupported attribute %s", $field); 
    608608            my $tmatch = 0; 
    609609            foreach (@{$parsed_filter{$field}}) { 
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Log.pm

    r1455 r1698  
    4747%EXPORT_TAGS = (LOGLEVELS => [ @loglevels ]); 
    4848 
    49 our $VERSION = (q$Rev$ =~ /^Rev: (\d+) /)[0]; 
     49our $VERSION = (q$Rev: 1455 $ =~ /^Rev: (\d+) /)[0]; 
    5050 
    5151my %lastmessages = (); 
     
    173173    my ($level, $msg, @args) = @_; 
    174174    no warnings 'printf'; 
     175    if (!$msg) { 
     176        my @call = caller(); 
     177        la_log(LA_WARN, 'empty message at %s:%s', $call[1], $call[2]); 
     178        return; 
     179    } 
    175180    $lastmessages{$level} = sprintf($msg, map { defined($_) ? $_ : '' } @args); 
    176181    if ($log_method{syslog}) { 
Note: See TracChangeset for help on using the changeset viewer.