2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-11 20:39:47 +00:00

- Added some log messages

git-svn-id: https://svn.fhem.de/fhem/trunk@4237 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
mangeimarkus 2013-11-17 16:59:09 +00:00
parent 0de83c1222
commit e09e6336a6
5 changed files with 38 additions and 7 deletions

View File

@ -1,3 +1,7 @@
0.45:
- Added some Logs for debug (mangei.markus)
older version 0.45:
- Added JSON librabry as alternative for JSON::XS (mangei.markus)
- Added webcam widget (marcproe)
- path to background image is now configurable via the YAF interface (marcproe)

View File

@ -50,7 +50,7 @@ use vars qw($FW_dir);
sub YAF_Request($@);
my $fhem_url;
my $yaf_version=0.41;
my $yaf_version=0.45;
my $yafw_encoding = "UTF-8";
my $mp = AttrVal("global", "modpath", ".");
my $yaf_www_directory = $mp."/FHEM/YAF/www";
@ -127,7 +127,9 @@ sub YAF_LoadResource($@) {
# Extension
my @filenameSplitted = split(/\./, $filename);
my $extension = $filenameSplitted[scalar(@filenameSplitted)-1];
#Log 1,"YAF_LoadResource absoluteFilePath $absoluteFilePath filename $filename extension $extension";
# Log for debug
Log 1,"YAF_LoadResource: absoluteFilePath = $absoluteFilePath; filename = $filename; extension = $extension";
# Datei laden
if ((-f $absoluteFilePath) && open($fh, "<", $absoluteFilePath)) {
@ -140,7 +142,7 @@ sub YAF_LoadResource($@) {
else {
# Datei nicht gefunden
Log 1,"YAF_LoadResource: file $filename not found";
return YAF_NotFound($absoluteFilePath);
return YAF_NotFound($absoluteFilePath, $file_local);
}
close($fh);
@ -206,7 +208,6 @@ sub YAF_define ($@) {
sub YAF_LoadView($@) {
my ($view) = @_;
YAF_Print("ddd");
return ("text/html; charset=$yafw_encoding", $FW_RET);
}
@ -222,7 +223,10 @@ sub YAF_Request ($@) {
my ($htmlarg) = @_;
# %20 durch Leerzeichen ersetzen
$htmlarg =~ s/%20/ /g;
# Log for debug
Log 1,"YAF_Request: htmlarg: $htmlarg";
# GET Parameter
my @params = split(/\?/, $htmlarg);
@ -390,7 +394,9 @@ sub YAF_Request ($@) {
YAF_Print("1");
}
else {
Log 3, "Error in saving config";
YAF_Print("0");
}
}
else {
@ -438,6 +444,8 @@ sub YAF_Request ($@) {
sub YAF_NotFound{
my $file = $_[0];
YAF_Print("Error 404: $file");
YAF_Print("\n");
YAF_Print("Absolute path: $file\n");
YAF_Print("\n");
return ("text/html; charset=$yafw_encoding", $FW_RET);
}

View File

@ -0,0 +1,19 @@
package YAF::YAFApplication;
use strict;
use warnings;
use base "YAFWebserver::YAFApplicationBase";
sub new {
my $class = shift;
my $self = YAFWebserver::YAFApplicationBase->new;
# routes
$self->add_route("^/Error\$", "YAFWebserver::Controller::DebugRequest", "show_error");
$self->add_route("^/.*\$", "YAFWebserver::Controller::DebugRequest", "show_debug");
bless $self, $class;
}
1;

View File

@ -27,7 +27,7 @@ package main;
use strict;
use warnings;
my $yaf_version=0.41;
my $yaf_version=0.45;
my %fhemwidgets;
my %fhemviews;

View File

@ -27,7 +27,7 @@ package main;
use strict;
use warnings;
my $yaf_version = 0.41;
my $yaf_version = 0.45;
my $mp = AttrVal("global", "modpath", ".");
my $yaf_dir = $mp."/FHEM/YAF/";
my @yaf_widgets;