2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 06:39:11 +00:00

93_DbLog: logfile entry if DBI module not installed, Forum: #109382

git-svn-id: https://svn.fhem.de/fhem/trunk@21483 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2020-03-22 16:06:11 +00:00
parent b4ee811f32
commit 513441e641
2 changed files with 9 additions and 5 deletions

View File

@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it.
- change: 93_DbLog: logfile entry if DBI module not installed, Forum: #109382
- bugfix: 70_BOTVAC: handle some initial values
- feature: 31_HUEDevice: added batteryPercent reading
battery reading is deprecated, will be removed later

View File

@ -30,6 +30,7 @@ no if $] >= 5.017011, warnings => 'experimental::smartmatch';
# Version History intern by DS_Starter:
our %DbLog_vNotesIntern = (
"4.9.11" => "22.03.2020 logfile entry if DBI module not installed, Forum: #109382 ",
"4.9.10" => "31.01.2020 fix warning, Forum: #107950 ",
"4.9.9" => "21.01.2020 default ParseEvent changed again, Forum: #106769 ",
"4.9.8" => "17.01.2020 adjust configCheck with plotEmbed check. Forum: #107383 ",
@ -303,15 +304,17 @@ return;
###############################################################
sub DbLog_Define($@) {
my ($hash, $def) = @_;
my @a = split("[ \t][ \t]*", $def);
my $name = $hash->{NAME};
my @a = split("[ \t][ \t]*", $def);
return "Error: Perl module ".$DbLogMMDBI." is missing.
Install it on Debian with: sudo apt-get install libdbi-perl" if($DbLogMMDBI);
if($DbLogMMDBI) {
Log3($name, 1, "DbLog $name - ERROR - Perl module ".$DbLogMMDBI." is missing. DbLog module is not loaded ! On Debian systems you can install it with \"sudo apt-get install libdbi-perl\" ");
return "Error: Perl module ".$DbLogMMDBI." is missing. Install it on Debian with: sudo apt-get install libdbi-perl";
}
return "wrong syntax: define <name> DbLog configuration regexp"
if(int(@a) != 4);
my $name = $hash->{NAME};
$hash->{CONFIGURATION} = $a[2];
my $regexp = $a[3];
@ -341,7 +344,7 @@ sub DbLog_Define($@) {
my $ret = DbLog_readCfg($hash);
if ($ret) {
# return on error while reading configuration
Log3($hash->{NAME}, 1, "DbLog $hash->{NAME} - Error while reading $hash->{CONFIGURATION}: '$ret' ");
Log3($name, 1, "DbLog $name - Error while reading $hash->{CONFIGURATION}: '$ret' ");
return $ret;
}