Implement logging via Log::Any, cleanup, remove logger()

This commit is contained in:
eleksir
2020-12-13 15:51:24 +03:00
parent a9193faf12
commit e861f5420b
13 changed files with 146 additions and 173 deletions

View File

@@ -9,15 +9,13 @@ use English qw( -no_match_vars );
use Digest::SHA qw(sha1_base64);
use DB_File;
use Carp qw(cluck);
use conf qw(loadConf);
use vars qw/$VERSION/;
use Exporter qw(import);
our @EXPORT_OK = qw(karmaSet karmaGet);
$VERSION = '1.0';
use conf qw(loadConf);
my $c = loadConf();
my $karmadir = $c->{karma}->{dir};
my $max = 5;
@@ -41,7 +39,7 @@ sub karmaSet (@) {
# init hash, store phrase and score
tie my %karma, 'DB_File', $karmafile || do {
cluck "Something nasty happen when cachedata ties to its data: $OS_ERROR";
cluck "[ERROR] Something nasty happen when cachedata ties to its data: $OS_ERROR";
return sprintf 'Карма %s составляет 0', $phrase;
};
@@ -100,7 +98,7 @@ sub karmaGet (@) {
# init hash, store phrase and score
tie my %karma, 'DB_File', $karmafile || do {
cluck "Something nasty happen when karma ties to its data: $OS_ERROR";
cluck "[ERROR] Something nasty happen when karma ties to its data: $OS_ERROR";
return sprintf 'Карма %s составляет 0', $phrase;
};