Skip to content

Commit

Permalink
[Whitespace] Add extra logging to Whitespace call method
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismytton committed May 13, 2024
1 parent 10c84d5 commit d94cfd9
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions perllib/Integrations/Whitespace.pm
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ package Integrations::Whitespace;
use strict;
use warnings;
use Moo;
use JSON::MaybeXS qw(encode_json);

use FixMyStreet;

use SOAP::Lite; # +trace => [qw(debug)];

with 'FixMyStreet::Roles::SOAPIntegration';
with 'FixMyStreet::Roles::ParallelAPI';
with 'FixMyStreet::Roles::Syslog';

has attr => ( is => 'ro', default => 'http://webservices.whitespacews.com/' );
has username => ( is => 'ro' );
Expand Down Expand Up @@ -63,9 +65,23 @@ has security => (

has backend_type => ( is => 'ro', default => 'whitespace' );

has log_ident => (
is => 'ro',
default => sub {
my $feature = 'whitespace';
my $features = FixMyStreet->config('COBRAND_FEATURES');
return unless $features && ref $features eq 'HASH';
return unless $features->{$feature} && ref $features->{$feature} eq 'HASH';
my $f = $features->{$feature}->{_fallback};
return $f->{log_ident};
}
);

sub call {
my ($self, $method, @params) = @_;

$self->log("Calling $method with params: " . encode_json(\@params));

require SOAP::Lite;
@params = make_soap_structure(@params);
my $som = $self->endpoint->call(
Expand Down

0 comments on commit d94cfd9

Please sign in to comment.