<html><head><title>WebService::Hexonet::Connector::Logger</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" >
</head>
<body class='pod'>
<!--
  generated by Pod::Simple::HTML v3.35,
  using Pod::Simple::PullParser v3.35,
  under Perl v5.030001 at Thu Jul 16 08:59:57 2020 GMT.

 If you want to change this HTML document, you probably shouldn't do that
   by changing it directly.  Instead, see about changing the calling options
   to Pod::Simple::HTML, and/or subclassing Pod::Simple::HTML,
   then reconverting this document from the Pod source.
   When in doubt, email the author of Pod::Simple::HTML for advice.
   See 'perldoc Pod::Simple::HTML' for more info.

-->

<!-- start doc -->
<a name='___top' class='dummyTopAnchor' ></a>

<h1><a class='u'
name="NAME"
>NAME</a></h1>

<p>WebService::Hexonet::Connector::Logger - Library to cover API request and response data output / logging.</p>

<h1><a class='u'
name="SYNOPSIS"
>SYNOPSIS</a></h1>

<p>This module is internally used by the <a href="http://search.cpan.org/perldoc?WebService%3A%3AHexonet%3A%3AConnector%3A%3AAPIClient" class="podlinkpod"
>WebService::Hexonet::Connector::APIClient</a> module.
To be used in the way:</p>

<pre>    # create a new instance by
    $logger = WebService::Hexonet::Connector::Logger-&#62;new();

    # Log API Request / Response Data
    # * specify request data in $data in string format
    # * specify an instance of WebService::Hexonet::Connector::Response in $r.    
    # * specify an error message as string in $error (optional parameter)
    $logger-&#62;log( $data, $r, $error );
    #  vs.
    $logger-&#62;log( $data, $r );    </pre>

<h1><a class='u'
name="DESCRIPTION"
>DESCRIPTION</a></h1>

<p>HEXONET Backend API communication will be printed to STDOUT/STDERR by default. This mechanism can be overwritten by a CustomLogger implementation. Use method setCustomLogger of WebService::Hexonet::Connector::APIClient for this. Important is that a custom implementation provides method `log` and supports all the arguments explained.</p>

<h2><a class='u'
name="Methods"
>Methods</a></h2>

<dl>
<dt><a name="new"
><code>new</code></a></dt>

<dd>
<p>Returns a new <a href="http://search.cpan.org/perldoc?WebService%3A%3AHexonet%3A%3AConnector%3A%3ALogger" class="podlinkpod"
>WebService::Hexonet::Connector::Logger</a> object.</p>

<dt><a name="log($post,_$r,_$error)"
><code>log($post, $r, $error)</code></a></dt>

<dd>
<p>Log API Request / Response Data Specify request data in $data in string format Specify an instance of WebService::Hexonet::Connector::Response in $r. Specify an error message as string in $error. Optional. Thought for forwarding HTTP errors.</p>
</dd>
</dl>

<h1><a class='u'
name="LICENSE_AND_COPYRIGHT"
>LICENSE AND COPYRIGHT</a></h1>

<p>This program is licensed under the <a href="https://raw.githubusercontent.com/hexonet/perl-sdk/master/LICENSE" class="podlinkurl"
>MIT License</a>.</p>

<h1><a class='u'
name="AUTHOR"
>AUTHOR</a></h1>

<p><a href="https://www.hexonet.net" class="podlinkurl"
>HEXONET GmbH</a></p>

<!-- end doc -->

</body></html>