diff options
author | Andy Shevchenko <andy@smile.org.ua> | 2013-05-05 08:02:27 +0000 |
---|---|---|
committer | Andy Shevchenko <andy@smile.org.ua> | 2013-05-05 08:02:27 +0000 |
commit | a89c9d096b6873961cb2f4358e1f59db2c4e9bb1 (patch) | |
tree | 664fb68c950e690a6872378e23a55a536e967956 | |
parent | 388814857c45c9076d88da6eb89c7180e9b7dbfd (diff) | |
download | renrot-a89c9d096b6873961cb2f4358e1f59db2c4e9bb1.tar.gz renrot-a89c9d096b6873961cb2f4358e1f59db2c4e9bb1.tar.bz2 |
logging: reduce amount of parameters
Quiet has the same semantics as Verbose. Let Verbose reflect both of
them.
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
git-svn-id: file:///svnroot/renrot/trunk@619 fe2816f4-e837-0410-b10a-f608c9d244a1
-rw-r--r-- | lib/Image/RenRot/Logging.pm | 5 | ||||
-rwxr-xr-x | renrot | 3 |
2 files changed, 3 insertions, 5 deletions
diff --git a/lib/Image/RenRot/Logging.pm b/lib/Image/RenRot/Logging.pm index 9706c8d..e56a79c 100644 --- a/lib/Image/RenRot/Logging.pm +++ b/lib/Image/RenRot/Logging.pm @@ -23,14 +23,13 @@ use Image::RenRot::Util; use vars qw(@ISA @EXPORT); @ISA = qw(Exporter); @EXPORT = qw(procmsg infomsg warnmsg errmsg fatalmsg dbgmsg ldbg3 ldbg3opts); my %options = ( - Quiet => 0, # suppressing messages - Verbose => 0, # verbosity of output + Verbose => 0, # verbosity of output, -1 means to suppress messages UseColor => 0, # whether use color output ); # # Colors hash # @@ -85,13 +84,13 @@ sub do_print { } } } # general processing message sub procmsg { - do_print('process', @_) if ($options{Quiet} == 0); + do_print('process', @_) if ($options{Verbose} >= 0); } # information message sub infomsg { do_print('info', @_); } @@ -404,14 +404,13 @@ sub getOptions { "v+" => \$verbose, "version" => sub { usage(0, 0) }, "work-directory|d=s" => \$workDir, ) or usage(1, 1); # Set the verbosity first - Image::RenRot::Logging->set(Quiet => $quiet, - Verbose => $verbose); + Image::RenRot::Logging->set(Verbose => $quiet ? -1 : $verbose); my $fileCount = scalar(@ARGV); foreach my $key (keys %$ll_opts) { # Parse long list option if (defined ${$ll_opts->{$key}{'s'}}) { |