Added some debugging to the FileLog get function

git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@3366 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig
2013-06-30 09:12:41 +00:00
parent a5dae8e241
commit d4abf0914c

View File

@@ -25,7 +25,8 @@ FileLog_Initialize($)
$hash->{NotifyFn} = "FileLog_Log";
$hash->{AttrFn} = "FileLog_Attr";
# logtype is used by the frontend
$hash->{AttrList} = "disable:0,1 logtype nrarchive archivedir archivecmd";
$hash->{AttrList} = "disable:0,1 logtype nrarchive archivedir archivecmd ".
"loglevel";
$hash->{FW_summaryFn} = "FileLog_fhemwebFn";
$hash->{FW_detailFn} = "FileLog_fhemwebFn";
@@ -378,6 +379,9 @@ FileLog_Get($@)
my $to = shift @a; # Now @a contains the list of column_specs
my $internal;
my $name = $hash->{NAME};
my $ll = GetLogLevel($name,4);
if($outf eq "INT") {
$outf = "-";
$internal = 1;
@@ -414,10 +418,12 @@ FileLog_Get($@)
# Look for the file in the log directory...
if(!-f $linf) {
# ... or in the archivelog
$linf = AttrVal($hash->{NAME},"archivedir",".") ."/". $inf;
$linf = AttrVal($name, "archivedir",".") ."/". $inf;
}
$inf = $linf;
}
Log $ll, "$name get: Input file $inf, from:$from to:$to";
my $ifh = new IO::File $inf if($inf);
seekTo($inf, $ifh, $hash, $from) if($ifh);
@@ -633,6 +639,9 @@ RESCAN:
$data{"currval$j"} = $lastv[$i];
$data{"currdate$j"} = $lastd[$i];
Log $ll, "$name get: line $j, regexp:".$d[$i]->{re}.", col:".$d[$i]->{col}.
", output lines:".$data{"cnt$j"};
}
if($internal) {
$internal_data = \$ret;
@@ -903,6 +912,7 @@ seekTo($$$$)
</li><br>
<li><a href="#disable">disable</a></li>
<li><a href="#loglevel">loglevel</a></li>
<a name="logtype"></a>
<li>logtype<br>