mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 06:39:11 +00:00
fhem.pl: add -d option for debugging (Forum #74774)
git-svn-id: https://svn.fhem.de/fhem/trunk@14828 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
dd8719f87c
commit
e3f5399e87
@ -1,5 +1,6 @@
|
|||||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
# 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.
|
# Do not insert empty lines here, update check depends on it.
|
||||||
|
- feature: fhem.pl: add -d option for debugging (Forum #74774)
|
||||||
- bugfix: 74_AMADDevice: fix decode_utf8 call in eval
|
- bugfix: 74_AMADDevice: fix decode_utf8 call in eval
|
||||||
- feature: 57_Calendar: reduce memory footprint (forum #74481)
|
- feature: 57_Calendar: reduce memory footprint (forum #74481)
|
||||||
- bugfix: 74_AMADDevice: fix openurl bug
|
- bugfix: 74_AMADDevice: fix openurl bug
|
||||||
|
11
fhem/fhem.pl
11
fhem/fhem.pl
@ -399,6 +399,9 @@ $readingFnAttributes = "event-on-change-reading event-on-update-reading ".
|
|||||||
|
|
||||||
###################################################
|
###################################################
|
||||||
# Start the program
|
# Start the program
|
||||||
|
my $fhemdebug;
|
||||||
|
$fhemdebug = shift @ARGV if($ARGV[0] eq "-d");
|
||||||
|
|
||||||
if(int(@ARGV) < 1) {
|
if(int(@ARGV) < 1) {
|
||||||
print "Usage:\n";
|
print "Usage:\n";
|
||||||
print "as server: fhem configfile\n";
|
print "as server: fhem configfile\n";
|
||||||
@ -2751,6 +2754,10 @@ CommandAttr($$)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($fhemdebug && $sdev eq "global") {
|
||||||
|
$a[2] = "-" if($attrName eq "logfile");
|
||||||
|
$a[2] = 5 if($attrName eq "verbose");
|
||||||
|
}
|
||||||
$ret = CallFn($sdev, "AttrFn", "set", @a);
|
$ret = CallFn($sdev, "AttrFn", "set", @a);
|
||||||
if($ret) {
|
if($ret) {
|
||||||
push @rets, $ret;
|
push @rets, $ret;
|
||||||
@ -3960,6 +3967,10 @@ setGlobalAttrBeforeFork($)
|
|||||||
my ($n,$v) = ($1,$2);
|
my ($n,$v) = ($1,$2);
|
||||||
$v =~ s/#.*//;
|
$v =~ s/#.*//;
|
||||||
$v =~ s/ .*$//;
|
$v =~ s/ .*$//;
|
||||||
|
if($fhemdebug) {
|
||||||
|
$v = "-" if($n eq "logfile");
|
||||||
|
$v = 5 if($n eq "verbose");
|
||||||
|
}
|
||||||
$attr{global}{$n} = $v;
|
$attr{global}{$n} = $v;
|
||||||
GlobalAttr("set", "global", $n, $v);
|
GlobalAttr("set", "global", $n, $v);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user