diff options
author | Andy Shevchenko <andy@smile.org.ua> | 2013-05-05 08:02:37 +0000 |
---|---|---|
committer | Andy Shevchenko <andy@smile.org.ua> | 2013-05-05 08:02:37 +0000 |
commit | 7fb94f7d2ebf4ff8590cc65c861e44378f200854 (patch) | |
tree | 806f2af259ae02781418cc02271c3384350a0b3b /lib | |
parent | a89c9d096b6873961cb2f4358e1f59db2c4e9bb1 (diff) | |
download | renrot-7fb94f7d2ebf4ff8590cc65c861e44378f200854.tar.gz renrot-7fb94f7d2ebf4ff8590cc65c861e44378f200854.tar.bz2 |
logging: move die_renrot() to Logging module
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
git-svn-id: file:///svnroot/renrot/trunk@620 fe2816f4-e837-0410-b10a-f608c9d244a1
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Image/RenRot/Logging.pm | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/Image/RenRot/Logging.pm b/lib/Image/RenRot/Logging.pm index e56a79c..5811004 100644 --- a/lib/Image/RenRot/Logging.pm +++ b/lib/Image/RenRot/Logging.pm @@ -23,7 +23,7 @@ use Image::RenRot::Util; use vars qw(@ISA @EXPORT); @ISA = qw(Exporter); -@EXPORT = qw(procmsg infomsg warnmsg errmsg fatalmsg dbgmsg ldbg3 ldbg3opts); +@EXPORT = qw(procmsg infomsg warnmsg errmsg fatalmsg dbgmsg ldbg3 ldbg3opts die_renrot); my %options = ( Verbose => 0, # verbosity of output, -1 means to suppress messages @@ -163,4 +163,20 @@ sub ldbg3opts { } ######################################################################################## +# Usage : die_renrot() +# Purpose : dies differently depend on verbose level +# Returns : nothing +# Parameters : error message +# Throws : no exceptions +# Comments : pretty output when die with verbose level is zero +# See Also : n/a +sub die_renrot { + fatalmsg (@_); + if ($options{Verbose} > 0) { + die("Fatal"); + } + exit 127; +} + +######################################################################################## 1; # end |