From f4523e34e6252e88c3f02b616f447d661ecb62f7 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Mon, 13 Jul 2015 19:58:38 +0200 Subject: [PATCH] Don't log get_event_list API calls --- lib/Vroom/Constants.pm | 5 ++++- vroom.pl | 10 ++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/Vroom/Constants.pm b/lib/Vroom/Constants.pm index ab16147..1f4cd48 100644 --- a/lib/Vroom/Constants.pm +++ b/lib/Vroom/Constants.pm @@ -4,7 +4,7 @@ use strict; use warnings; use base 'Exporter'; -our @EXPORT = qw/DB_VERSION COMPONENTS MOH JS_STRINGS API_ACTIONS/; +our @EXPORT = qw/DB_VERSION COMPONENTS MOH JS_STRINGS API_ACTIONS API_NO_LOG/; # Database version use constant DB_VERSION => 8; @@ -130,4 +130,7 @@ use constant API_ACTIONS => { } }; +# List of API actions for which we do not want to log an event +use constant API_NO_LOG => qw(get_event_list); + 1; diff --git a/vroom.pl b/vroom.pl index 5d3828b..7409c09 100755 --- a/vroom.pl +++ b/vroom.pl @@ -1590,10 +1590,12 @@ any '/api' => sub { ); } - $self->log_event({ - event => 'api_action_allowed', - msg => "API Key $token calls API action $req->{action}" - }); + if (!grep { $_ eq $req->{action} } API_NO_LOG){ + $self->log_event({ + event => 'api_action_allowed', + msg => "API Key $token calls API action $req->{action}" + }); + } # Here are methods not tied to a room if ($req->{action} eq 'get_room_list'){