Skip to content

Commit

Permalink
issue #116 Добавил логирование
Browse files Browse the repository at this point in the history
  • Loading branch information
iMega committed Oct 23, 2016
1 parent 050bd9c commit 6dfb64c
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 4 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"firebase/php-jwt": "v4.0.0",
"guzzlehttp/guzzle": "6.2.1",
"packaged/querybuilder":"0.16.1",
"ramsey/uuid": "^3.5"
"ramsey/uuid": "^3.5",
"monolog/monolog": "^1.21"
},
"require-dev": {
"phpunit/phpunit": "5.5.5",
Expand Down
82 changes: 80 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,5 +177,13 @@
$rangePosition['longitude'][MIN] <= $longitude &&
$longitude <= $rangePosition['longitude'][MAX];
};
}
},
'logger' => function () {
$logger = new Monolog\Logger('kubikvest');
$logger->setHandlers([
new Monolog\Handler\StreamHandler('php://stdout'),
]);

return $logger;
},
];
9 changes: 9 additions & 0 deletions web/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,15 @@
'finish' => false,
];
unset($response['point']['prompt']);
$app['logger']->log(
\Psr\Log\LogLevel::INFO,
'Checkout',
[
'lat' => $data['lat'],
'lng' => $data['lng'],
'acr' => $data['acr'],
]
);
if (! $point->checkCoordinates((double) $data['lat'], (double) $data['lng'])) {
$distances = $point->calcDistanceToPointsSector((double) $data['lat'], (double) $data['lng']);
if (! $point->checkAccuracy((int) $data['acr'], min($distances))) {
Expand Down

0 comments on commit 6dfb64c

Please sign in to comment.