mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-07 19:04:20 +00:00
93_DbLog: contrib 5.10.0
git-svn-id: https://svn.fhem.de/fhem/trunk@28656 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
0eb64496fd
commit
afa3b62322
@ -61,7 +61,7 @@ use vars qw($FW_ME $FW_subdir); # predeclar
|
|||||||
# Version History intern by DS_Starter:
|
# Version History intern by DS_Starter:
|
||||||
my %DbLog_vNotesIntern = (
|
my %DbLog_vNotesIntern = (
|
||||||
"5.10.0" => "07.03.2024 support of MariaDB driver, optimize Timer execMemCacheAsync, change DbLog_configcheck, _DbLog_SBP_connectDB ".
|
"5.10.0" => "07.03.2024 support of MariaDB driver, optimize Timer execMemCacheAsync, change DbLog_configcheck, _DbLog_SBP_connectDB ".
|
||||||
"remove countNbl, support compression between client and server ",
|
"remove countNbl, support compression between client and server, improved performance if attr excludeDevs is set ",
|
||||||
"5.9.6" => "09.03.2024 change META.json ",
|
"5.9.6" => "09.03.2024 change META.json ",
|
||||||
"5.9.5" => "04.01.2024 change DbLog_configcheck to select only column width independent from column characteristic ",
|
"5.9.5" => "04.01.2024 change DbLog_configcheck to select only column width independent from column characteristic ",
|
||||||
"5.9.4" => "03.01.2024 make EVENT writable ",
|
"5.9.4" => "03.01.2024 make EVENT writable ",
|
||||||
@ -93,51 +93,6 @@ my %DbLog_vNotesIntern = (
|
|||||||
"5.5.11" => "09.01.2023 more code rework / structured subroutines ",
|
"5.5.11" => "09.01.2023 more code rework / structured subroutines ",
|
||||||
"5.5.10" => "07.01.2023 more code rework (_DbLog_SBP_checkDiscDelpars) and others, use dbh quote in _DbLog_SBP_onRun_LogSequential ".
|
"5.5.10" => "07.01.2023 more code rework (_DbLog_SBP_checkDiscDelpars) and others, use dbh quote in _DbLog_SBP_onRun_LogSequential ".
|
||||||
"configCheck changed to use only one db connect + measuring the connection time, universal DBHU ",
|
"configCheck changed to use only one db connect + measuring the connection time, universal DBHU ",
|
||||||
"5.5.9" => "28.12.2022 optimize \$hash->{HELPER}{TH}, \$hash->{HELPER}{TC}, mode in Define ".
|
|
||||||
"Forum: https://forum.fhem.de/index.php/topic,130588.msg1254073.html#msg1254073 ",
|
|
||||||
"5.5.8" => "27.12.2022 two-line output of long state messages, define LONGRUN_PID threshold ",
|
|
||||||
"5.5.7" => "20.12.2022 cutted _DbLog_SBP_onRun_Log into _DbLog_SBP_onRun_LogArray and _DbLog_SBP_onRun_LogSequential ".
|
|
||||||
"__DbLog_SBP_onRun_LogCurrent, __DbLog_SBP_fieldArrays, some bugfixes, add drivers to configCheck, edit comref ",
|
|
||||||
"5.5.6" => "12.12.2022 Serialize with Storable instead of JSON, more code rework ",
|
|
||||||
"5.5.5" => "11.12.2022 Array Log -> may be better error processing ",
|
|
||||||
"5.5.4" => "11.12.2022 Array Log -> print out all cache not saved, DbLog_DelayedShutdown processing changed ",
|
|
||||||
"5.5.3" => "10.12.2022 more internal code rework ",
|
|
||||||
"5.5.2" => "09.12.2022 _DbLog_ConnectPush function removed ",
|
|
||||||
"5.5.1" => "09.12.2022 commit inserted lines in array insert though some lines are faulty ",
|
|
||||||
"5.5.0" => "08.12.2022 implement commands with SBP: reduceLog, reduceLogNbL, attr timeout adapted ",
|
|
||||||
"5.4.0" => "07.12.2022 implement commands with SBP: importCacheFile ",
|
|
||||||
"5.3.0" => "05.12.2022 activate func _DbLog_SBP_onRun_Log, implement commands with SBP: count(Nbl), deleteOldDays(Nbl) ".
|
|
||||||
"userCommand, exportCache ",
|
|
||||||
"5.2.0" => "05.12.2022 LONGRUN_PID, \$hash->{prioSave}, rework SetFn ",
|
|
||||||
"5.1.0" => "03.12.2022 implement SubProcess for logging data in synchron Mode ",
|
|
||||||
"5.0.0" => "02.12.2022 implement SubProcess for logging data in asynchron Mode, delete attr traceHandles ",
|
|
||||||
"4.13.3" => "26.11.2022 revise commandref ",
|
|
||||||
"4.13.2" => "06.11.2022 Patch Delta calculation (delta-d,delta-h) https://forum.fhem.de/index.php/topic,129975.msg1242272.html#msg1242272 ",
|
|
||||||
"4.13.1" => "16.10.2022 edit commandref ",
|
|
||||||
"4.13.0" => "15.04.2022 new Attr convertTimezone, minor fixes in reduceLog(NbL) ",
|
|
||||||
"4.12.7" => "08.03.2022 \$data{firstvalX} doesn't work, forum: https://forum.fhem.de/index.php/topic,126631.0.html ",
|
|
||||||
"4.12.6" => "17.01.2022 change log message deprecated to outdated, forum:#topic,41089.msg1201261.html#msg1201261 ",
|
|
||||||
"4.12.5" => "31.12.2021 standard unit assignment for readings beginning with 'temperature' and removed, forum:#125087 ",
|
|
||||||
"4.12.4" => "27.12.2021 change ParseEvent for FBDECT, warning messages for deprecated commands added ",
|
|
||||||
"4.12.3" => "20.04.2021 change sub _DbLog_getNewDBHandle for SQLITE, change error Logging in DbLog_writeFileIfCacheOverflow ",
|
|
||||||
"4.12.2" => "08.04.2021 change standard splitting ",
|
|
||||||
"4.12.1" => "07.04.2021 improve escaping the pipe ",
|
|
||||||
"4.12.0" => "29.03.2021 new attributes SQLiteCacheSize, SQLiteJournalMode ",
|
|
||||||
"4.11.0" => "20.02.2021 new attr cacheOverflowThreshold, reading CacheOverflowLastNum/CacheOverflowLastState, ".
|
|
||||||
"remove prototypes, new subs DbLog_writeFileIfCacheOverflow, DbLog_setReadingstate ",
|
|
||||||
"4.10.2" => "23.06.2020 configCheck changed for SQLite again ",
|
|
||||||
"4.10.1" => "22.06.2020 configCheck changed for SQLite ",
|
|
||||||
"4.10.0" => "22.05.2020 improve configCheck, new vars \$LASTTIMESTAMP and \$LASTVALUE in valueFn / DbLogValueFn, Forum:#111423 ",
|
|
||||||
"4.9.13" => "12.05.2020 commandRef changed, AutoInactiveDestroy => 1 for dbh ",
|
|
||||||
"4.9.12" => "28.04.2020 fix line breaks in set function, Forum: #110673 ",
|
|
||||||
"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 ",
|
|
||||||
"4.9.7" => "13.01.2020 change datetime pattern in valueFn of DbLog_addCacheLine. Forum: #107285 ",
|
|
||||||
"4.9.6" => "04.01.2020 fix change off 4.9.4 in default splitting. Forum: #106992 ",
|
|
||||||
"4.9.5" => "01.01.2020 do not reopen database connection if device is disabled (fix) ",
|
|
||||||
"4.9.4" => "08.01.2023 all version informationen from v 1.8.1 to v 4.9.4 deleted ",
|
|
||||||
"1.7.1" => "15.12.2016 initial rework "
|
"1.7.1" => "15.12.2016 initial rework "
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -196,6 +151,8 @@ my $dblog_lrpth = 0.8;
|
|||||||
my $dblog_pifl = 40; # default Breite Eingabefelder im Plot Editor
|
my $dblog_pifl = 40; # default Breite Eingabefelder im Plot Editor
|
||||||
my $dblog_svgfnset = ',delta-d,delta-h,delta-ts,int,int1,int2,int3,int4,int5'; # Funktionen für SVG sampleDataFn
|
my $dblog_svgfnset = ',delta-d,delta-h,delta-ts,int,int1,int2,int3,int4,int5'; # Funktionen für SVG sampleDataFn
|
||||||
|
|
||||||
|
# $data{DbLog}{$name}{cache} # Log-Daten Arbeitscache
|
||||||
|
|
||||||
################################################################
|
################################################################
|
||||||
sub DbLog_Initialize {
|
sub DbLog_Initialize {
|
||||||
my $hash = shift;
|
my $hash = shift;
|
||||||
@ -1217,6 +1174,22 @@ sub DbLog_Log {
|
|||||||
my $max = int(@{$events});
|
my $max = int(@{$events});
|
||||||
my $vb4show = 0;
|
my $vb4show = 0;
|
||||||
my @vb4devs = split ",", AttrVal ($name, 'verbose4Devs', ''); # verbose4 Logs nur für Devices in Attr "verbose4Devs"
|
my @vb4devs = split ",", AttrVal ($name, 'verbose4Devs', ''); # verbose4 Logs nur für Devices in Attr "verbose4Devs"
|
||||||
|
my $exc = AttrVal ($name, 'excludeDevs', ''); # attr <device> excludeDevs [<devspec>#]<Reading1>,[<devspec>#]<Reading2>,[<devspec>#]<Reading..>
|
||||||
|
|
||||||
|
my @exdvs = ();
|
||||||
|
if ($exc) { # Excluded Devices & Readings
|
||||||
|
$exc =~ s/[\s\n]/,/g;
|
||||||
|
my @excldr = split ',', $exc;
|
||||||
|
|
||||||
|
for my $excl (@excldr) {
|
||||||
|
my ($ds,$rd) = split '#', $excl;
|
||||||
|
my @da = devspec2array ($ds);
|
||||||
|
|
||||||
|
for my $d (@da) {
|
||||||
|
push @exdvs, ($rd ? "$d:$rd" : $d);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!@vb4devs) {
|
if (!@vb4devs) {
|
||||||
$vb4show = 1;
|
$vb4show = 1;
|
||||||
@ -1306,38 +1279,22 @@ sub DbLog_Log {
|
|||||||
$unit = DbLog_charfilter($unit) if(AttrVal($name, "useCharfilter",0));
|
$unit = DbLog_charfilter($unit) if(AttrVal($name, "useCharfilter",0));
|
||||||
|
|
||||||
# Devices / Readings ausschließen durch Attribut "excludeDevs"
|
# Devices / Readings ausschließen durch Attribut "excludeDevs"
|
||||||
# attr <device> excludeDevs [<devspec>#]<Reading1>,[<devspec>#]<Reading2>,[<devspec>#]<Reading..>
|
for my $ed (@exdvs) { # $ed ist "$d[:$r]"
|
||||||
my ($exc,@excldr,$ds,$rd,@exdvs);
|
if ($ed =~ /:/xs) {
|
||||||
$exc = AttrVal($name, "excludeDevs", "");
|
if ("$dev_name:$reading" =~ m/^$ed$/) {
|
||||||
|
Log3 ($name, 4, qq{$name - Device:Reading "$dev_name:$reading" global excluded from logging by attribute "excludeDevs"}) if($log4rel);
|
||||||
if($exc) {
|
|
||||||
$exc =~ s/[\s\n]/,/g;
|
|
||||||
@excldr = split ',', $exc;
|
|
||||||
|
|
||||||
for my $excl (@excldr) {
|
|
||||||
($ds,$rd) = split '#', $excl;
|
|
||||||
@exdvs = devspec2array($ds);
|
|
||||||
|
|
||||||
if(@exdvs) {
|
|
||||||
for my $ed (@exdvs) {
|
|
||||||
if($rd) {
|
|
||||||
if("$dev_name:$reading" =~ m/^$ed:$rd$/) {
|
|
||||||
Log3 ($name, 4, "$name - Device:Reading \"$dev_name:$reading\" global excluded from logging by attribute \"excludeDevs\" ") if($log4rel);
|
|
||||||
$next = 1;
|
$next = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if ($dev_name =~ m/^$ed$/) {
|
if ($dev_name =~ m/^$ed$/) {
|
||||||
Log3 ($name, 4, "$name - Device \"$dev_name\" global excluded from logging by attribute \"excludeDevs\" ") if($log4rel);
|
Log3 ($name, 4, qq{$name - Device "$dev_name" global excluded from logging by attribute "excludeDevs"}) if($log4rel);
|
||||||
$next = 1;
|
$next = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
next if($next);
|
next if($next);
|
||||||
}
|
|
||||||
|
|
||||||
Log3 ($name, 5, "$name - parsed Event: $dev_name , Event: $event") if($log4rel);
|
Log3 ($name, 5, "$name - parsed Event: $dev_name , Event: $event") if($log4rel);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user