X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;f=lib%2FUtils.pm;h=a21d996ea1ae7cd00d50bb6c566838cfa1bb191c;hb=09d1aebd49467f5d146d58309d8b646e57ef582f;hp=74fe13c47b90656318854b9fdbad340c20e343ca;hpb=4e505de6fb967cd1fa4de37913ddacfeb1bf11f9;p=clearscm.git diff --git a/lib/Utils.pm b/lib/Utils.pm index 74fe13c..a21d996 100644 --- a/lib/Utils.pm +++ b/lib/Utils.pm @@ -346,6 +346,7 @@ Returns: =cut + $prompt ||= 'Password'; my $password; @@ -826,7 +827,8 @@ and the values of the hash will be the counters. =item $log -Logger object to log stats to (if specified) +Logger object to log stats to (if specified). Note: if the Logger object has +errors or warnings then they will be automatically included in the output. =back @@ -848,7 +850,12 @@ Returns: my $msg = "$FindBin::Script Run Statistics:"; - if (scalar keys %$total) { + if ($log and ref $log eq 'Logger') { + $total->{errors} = $log->{errors}; + $total->{warnings} = $log->{warnings}; + } # if + + if (keys %$total) { # Display statistics (if any) if ($log) { $log->msg ($msg); @@ -857,10 +864,10 @@ Returns: } # if foreach (sort keys %$total) { - $msg = $$total{$_} . "\t $_"; + $msg = $total->{$_} . "\t $_"; if ($log) { - $log->msg ($$total{$_} . "\t $_"); + $log->msg ($total->{$_} . "\t $_"); } else { display $msg; } # if @@ -935,8 +942,6 @@ L L -L - =head2 ClearSCM Perl Modules =for html

Display