summaryrefslogtreecommitdiff
path: root/lib/DBInfoscreen
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2020-06-12 08:04:00 +0200
committerDaniel Friesel <derf@finalrewind.org>2020-06-12 08:04:00 +0200
commit4587af307d0c5fc8b53d082f346fc5f5ba042168 (patch)
tree4f7d639a941ac97c8c5518807aa8578851c92bfa /lib/DBInfoscreen
parenteed252793c04e8b2816f26751657dad7169bded2 (diff)
use debug log for debug output
Diffstat (limited to 'lib/DBInfoscreen')
-rw-r--r--lib/DBInfoscreen/Controller/Map.pm3
-rw-r--r--lib/DBInfoscreen/Controller/Wagenreihung.pm3
2 files changed, 6 insertions, 0 deletions
diff --git a/lib/DBInfoscreen/Controller/Map.pm b/lib/DBInfoscreen/Controller/Map.pm
index 7b5a49b..91aefe6 100644
--- a/lib/DBInfoscreen/Controller/Map.pm
+++ b/lib/DBInfoscreen/Controller/Map.pm
@@ -31,6 +31,7 @@ sub get_hafas_polyline_p {
if ( my $content = $cache->thaw($url) ) {
$promise->resolve($content);
+ $self->app->log->debug("GET $url (cached)");
return $promise;
}
@@ -40,6 +41,7 @@ sub get_hafas_polyline_p {
->then(
sub {
my ($tx) = @_;
+ $self->app->log->debug("GET $url (OK)");
my $json = decode_json( $tx->res->body );
my @coordinate_list;
@@ -65,6 +67,7 @@ sub get_hafas_polyline_p {
)->catch(
sub {
my ($err) = @_;
+ $self->app->log->debug("GET $url (error: $err)");
$promise->reject($err);
}
)->wait;
diff --git a/lib/DBInfoscreen/Controller/Wagenreihung.pm b/lib/DBInfoscreen/Controller/Wagenreihung.pm
index a87bb29..7b59227 100644
--- a/lib/DBInfoscreen/Controller/Wagenreihung.pm
+++ b/lib/DBInfoscreen/Controller/Wagenreihung.pm
@@ -25,6 +25,7 @@ sub get_wagenreihung_p {
if ( my $content = $cache->thaw($url) ) {
$promise->resolve($content);
+ $self->app->log->debug("GET $url (cached)");
return $promise;
}
@@ -33,6 +34,7 @@ sub get_wagenreihung_p {
->then(
sub {
my ($tx) = @_;
+ $self->app->log->debug("GET $url (OK)");
my $body = decode( 'utf-8', $tx->res->body );
my $json = JSON->new->decode($body);
@@ -42,6 +44,7 @@ sub get_wagenreihung_p {
)->catch(
sub {
my ($err) = @_;
+ $self->app->log->debug("GET $url (error: $err)");
$promise->reject($err);
}
)->wait;