From 1dce059b6239a8d6125b934311bbe6bff9f72af9 Mon Sep 17 00:00:00 2001 From: dev0 <> Date: Fri, 4 Aug 2017 09:08:37 +0000 Subject: [PATCH] 34_ESPEasy.pm: minor fix for Data::Dumper usage git-svn-id: https://svn.fhem.de/fhem/trunk@14844 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/34_ESPEasy.pm | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/fhem/FHEM/34_ESPEasy.pm b/fhem/FHEM/34_ESPEasy.pm index e57f6363d..0f971f3c2 100644 --- a/fhem/FHEM/34_ESPEasy.pm +++ b/fhem/FHEM/34_ESPEasy.pm @@ -36,7 +36,7 @@ use Color; # ------------------------------------------------------------------------------ # global/default values # ------------------------------------------------------------------------------ -my $module_version = "1.22"; # Version of this module +my $module_version = "1.23"; # Version of this module my $minEEBuild = 128; # informational my $minJsonVersion = 1.02; # checked in received data @@ -600,8 +600,6 @@ sub ESPEasy_Read($) { my $bhash = $modules{ESPEasy}{defptr}{BRIDGE}{$ipv}; #hash of original instance my $bname = $bhash->{NAME}; my $btype = $bhash->{TYPE}; - $Data::Dumper::Indent = 0; - $Data::Dumper::Terse = 1; # Levering new TcpServerUtils security feature. #$attr{$name}{allowfrom} = ".*" if !$attr{$name}{allowfrom}; @@ -651,7 +649,8 @@ sub ESPEasy_Read($) { $logHeader->{Authorization} =~ s/Basic\s.*\s/Basic ***** / if defined $logHeader->{Authorization}; # Dump logHeader - Log3 $bname, 5, "$btype $name: Received header: ".Dumper($logHeader) if defined $logHeader; + Log3 $bname, 5, "$btype $name: Received header: ".ESPEasy_dumpSingleLine($logHeader) + if (defined $logHeader); # Dump content Log3 $bname, 5, "$btype $name: Received content: $data[1]" if defined $data[1]; @@ -2556,6 +2555,16 @@ sub ESPEasy_isHostname($) # ------------------------------------------------------------------------------ sub ESPEasy_whoami() {return (split('::',(caller(1))[3]))[1] || '';} +# ------------------------------------------------------------------------------ +sub ESPEasy_dumpSingleLine($) +{ + my $saveIndent = $Data::Dumper::Indent; my $saveTerse = $Data::Dumper::Terse ; + $Data::Dumper::Indent = 0; $Data::Dumper::Terse = 1; + my $ret = Dumper($_[0]); + $Data::Dumper::Indent = $saveIndent; $Data::Dumper::Terse = $saveTerse; + return $ret; +} + # ------------------------------------------------------------------------------ sub ESPEasy_removeGit($) {