Changeset 425


Ignore:
Timestamp:
10/11/12 15:07:47 (12 years ago)
Author:
Kris Deugau
Message:

/trunk

Tweak handling of log messages so that the location description
is logged, and only if there was one.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DNSDB.pm

    r420 r425  
    35373537  $logdata{entry} .= " [priority $dist] [weight $weight] [port $port]"
    35383538        if $typemap{$$rectype} eq 'SRV';
    3539   $logdata{entry} .= "', TTL $ttl, location $location";
     3539  $logdata{entry} .= "', TTL $ttl";
     3540  $logdata{entry} .= ", location ".getLoc($dbh, $location)->{description} if $location;
    35403541
    35413542  # Allow transactions, and raise an exception on errors so we can catch it later.
     
    36983699  $logdata{entry} .= " [priority $oldrec->{distance}] [weight $oldrec->{weight}] [port $oldrec->{port}]"
    36993700        if $typemap{$oldrec->{type}} eq 'SRV';
    3700   $logdata{entry} .= "', TTL $oldrec->{ttl}, location $oldrec->{location}\nto\n";
     3701  $logdata{entry} .= "', TTL $oldrec->{ttl}";
     3702  $logdata{entry} .= ", location ".getLoc($dbh, $oldrec->{location})->{description} if $oldrec->{location};
     3703  $logdata{entry} .= "\nto\n";
    37013704  # More NS special
    37023705  if ($revrec eq 'y' && $$rectype == 2) {
     
    37073710  $logdata{entry} .= " [distance $dist]" if $typemap{$$rectype} eq 'MX';
    37083711  $logdata{entry} .= " [priority $dist] [weight $weight] [port $port]" if $typemap{$$rectype} eq 'SRV';
    3709   $logdata{entry} .= "', TTL $ttl, location $location";
     3712  $logdata{entry} .= "', TTL $ttl";
     3713  $logdata{entry} .= ", location ".getLoc($dbh, $location)->{description} if $location;
    37103714
    37113715  local $dbh->{AutoCommit} = 0;
     
    37673771  $logdata{entry} .= " [priority $oldrec->{distance}] [weight $oldrec->{weight}] [port $oldrec->{port}]"
    37683772        if $typemap{$oldrec->{type}} eq 'SRV';
    3769   $logdata{entry} .= "', TTL $oldrec->{ttl}\n";
     3773  $logdata{entry} .= "', TTL $oldrec->{ttl}";
     3774  $logdata{entry} .= ", location ".getLoc($dbh, $oldrec->{location})->{description} if $oldrec->{location};
    37703775
    37713776  eval {
Note: See TracChangeset for help on using the changeset viewer.