mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-23 14:46:24 +00:00
93_DbLog:V3.8.0, log events containing pipe "|" possible
git-svn-id: https://svn.fhem.de/fhem/trunk@16021 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
df0f6b5353
commit
5398f96d68
@ -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:V3.8.0, log events containing pipe "|" possible
|
||||
- bugfix: 98_TRAFFIC: v1.3.5, fixed return readings in DbLog_SplitFn
|
||||
- feature: attr: -a and -r Options added (Forum #83414)
|
||||
- feature: 20_FRM_IN: added Firmata 2.5 feature PIN_MODE_PULLUP
|
||||
|
@ -16,6 +16,7 @@
|
||||
############################################################################################################################################
|
||||
# Versions History done by DS_Starter & DeeSPe:
|
||||
#
|
||||
# 3.8.0 26.01.2018 escape "|" in events to log events containing it
|
||||
# 3.7.1 25.01.2018 fix typo in commandref
|
||||
# 3.7.0 21.01.2018 parsed event with Log 5 added, configCheck enhanced by configuration read check
|
||||
# 3.6.5 19.01.2018 fix lot of logentries if disabled and db not available
|
||||
@ -180,7 +181,7 @@ use Blocking;
|
||||
use Time::HiRes qw(gettimeofday tv_interval);
|
||||
use Encode qw(encode_utf8);
|
||||
|
||||
my $DbLogVersion = "3.7.1";
|
||||
my $DbLogVersion = "3.8.0";
|
||||
|
||||
my %columns = ("DEVICE" => 64,
|
||||
"TYPE" => 64,
|
||||
@ -1222,6 +1223,7 @@ sub DbLog_Log($$) {
|
||||
if($dev_name =~ m/^$re$/ || "$dev_name:$event" =~ m/^$re$/ || $DbLogSelectionMode eq 'Include') {
|
||||
my $timestamp = $ts_0;
|
||||
$timestamp = $dev_hash->{CHANGETIME}[$i] if(defined($dev_hash->{CHANGETIME}[$i]));
|
||||
$event =~ s/\|/_ESC_/g; # escape Pipe "|"
|
||||
|
||||
my @r = DbLog_ParseEvent($dev_name, $dev_type, $event);
|
||||
$reading = $r[0];
|
||||
@ -1445,6 +1447,7 @@ sub DbLog_Push(@) {
|
||||
|
||||
foreach my $row (@row_array) {
|
||||
my @a = split("\\|",$row);
|
||||
s/_ESC_/\|/g for @a; # escaped Pipe return to "|"
|
||||
push(@timestamp, "$a[0]");
|
||||
push(@device, "$a[1]");
|
||||
push(@type, "$a[2]");
|
||||
@ -1851,6 +1854,7 @@ sub DbLog_PushAsync(@) {
|
||||
|
||||
foreach my $row (@row_array) {
|
||||
my @a = split("\\|",$row);
|
||||
s/_ESC_/\|/g for @a; # escaped Pipe return to "|"
|
||||
push(@timestamp, "$a[0]");
|
||||
push(@device, "$a[1]");
|
||||
push(@type, "$a[2]");
|
||||
@ -1984,6 +1988,7 @@ sub DbLog_PushAsync(@) {
|
||||
Log3 $hash->{NAME}, 4, "DbLog $name -> $ceti of $ceti events inserted into table history".($usepkh?" using PK on columns $pkh":"");
|
||||
} else {
|
||||
Log3 $hash->{NAME}, 4, "DbLog $name -> ".($ceti-$nins_hist)." of $ceti events inserted into table history".($usepkh?" using PK on columns $pkh":"");
|
||||
s/\|/_ESC_/g for @n2hist; # escape Pipe "|"
|
||||
$rowlist = join('§', @n2hist);
|
||||
$rowlist = encode_base64($rowlist,"");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user