Subject: | The client cannot be used independently |
Date: | Mon, 12 Aug 2013 13:05:34 +0000 |
To: | "bug-MojoX-JSON-RPC [...] rt.cpan.org" <bug-MojoX-JSON-RPC [...] rt.cpan.org> |
From: | Tudor Marghidanu <Tudor.Marghidanu [...] PropertyShark.com> |
Hello,
I noticed a limitation in Client.pm which makes the class unusable with third party JSON-RPC services.
sub _process_result {
my ( $self, $tx ) = @_;
$self->tx($tx); # save latest transaction
my $tx_res = $tx->res;
my $log = $self->ua->app->log;
if ( $log->is_debug ) {
$log->debug( 'TX BODY: [' . $tx_res->body . ']' );
}
…
The logging introduces the limitation, I'm trying to use the client in a console application over a set of services provided by some remote site. Since the console application doesn't have a Mojo application behind the scenes, the MojoX::JSON::RPC::Client doesn't work. Of course I could easily patch it, but it would be better if the client would detect the context in which is running and adjust.
Thank you!
Tudor Marghidanu