Skip to content

Commit

Permalink
Added logging variable to configuration file
Browse files Browse the repository at this point in the history
If set to true, requests and responses will be logged even if in production mode.
  • Loading branch information
daredloco committed Feb 15, 2024
1 parent 0beff72 commit 90f9905
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"license": "MIT",
"description": "Payment package for live-controls",
"type": "library",
"version": "2.1.6",
"version": "2.1.7",
"autoload": {
"psr-4": {
"LiveControls\\Payment\\": "src/"
Expand Down
1 change: 1 addition & 0 deletions config/config.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

return [
'logging' => true,
'debug' => config('app.debug', false),
'pagseguro_email_debug' => env('PAGSEGURO_EMAIL_DEBUG',null),
'pagseguro_token_debug' => env('PAGSEGURO_TOKEN_DEBUG', null),
Expand Down
2 changes: 1 addition & 1 deletion src/Scripts/PagSeguro/RedirectCheckout3.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public static function generateDigitalCode(array $items, PaymentSender|null $sen
if($response->getStatusCode() != 200 && $response->getStatusCode() != 201){
throw new Exception($response->getStatusCode().': '.$response->getBody());
}
if(config('livecontrols_payment.debug')){
if(config('livecontrols_payment.debug') || config('livecontrols_payment.logging')){
Log::debug('[PAGSEGURO REQUEST] '.json_encode($requestArray));
Log::debug('[PAGSEGURO RESPONSE] '.$response->getBody());
}
Expand Down

0 comments on commit 90f9905

Please sign in to comment.