commit 040156866f511f8b5b0f0ab5e6a5376f5fb72741 from: Izzy Blacklock date: Sun Jul 30 18:28:21 2023 UTC added IRCNOW::IO::verbosity2const() function commit - 3bc13fbbeed050a5635b42ea44aa69410ec34cf9 commit + 040156866f511f8b5b0f0ab5e6a5376f5fb72741 blob - d5ce0cde1c5086dfd065d28a2c30aeef13e5b49b blob + 22712a6e08e33c5a16a2f3e2da507d34fff23d57 --- lib/IRCNOW/IO.pm +++ lib/IRCNOW/IO.pm @@ -48,7 +48,19 @@ sub debug { my ($level, $msg) = @_; if ($verbosity >= $level) { print "$msg\n"; } } +sub verbosity2const { + my $str=shift; + my $verbosity = { + NONE => 0, + ERRORS => 1, + WARNINGS => 2, + INFO => 3, + ALL => 4, + }; + return $verbosity->{$str}; +} + ####################################################################################### # Basic file IO # #######################################################################################