2016-07-22 20:00:27 +00:00
|
|
|
<?php
|
|
|
|
|
2018-05-23 10:14:20 +00:00
|
|
|
class Log extends Vn\Web\JsonRequest {
|
2016-09-06 14:25:02 +00:00
|
|
|
const PARAMS = [
|
2019-09-05 16:16:10 +00:00
|
|
|
'message'
|
|
|
|
,'file'
|
2016-09-06 14:25:02 +00:00
|
|
|
,'line'
|
2019-09-05 16:16:10 +00:00
|
|
|
,'location'
|
|
|
|
,'agent'
|
2016-09-06 14:25:02 +00:00
|
|
|
,'stack'
|
|
|
|
];
|
|
|
|
|
2019-09-06 09:22:34 +00:00
|
|
|
function run($db) {
|
|
|
|
if (!_ENABLE_DEBUG) return TRUE;
|
|
|
|
|
2018-05-23 10:14:20 +00:00
|
|
|
$user = isset($_SESSION['user']) ? $_SESSION['user'] : 'guest';
|
2019-09-05 16:16:10 +00:00
|
|
|
$message = $_REQUEST['message'];
|
|
|
|
$file = $_REQUEST['file'];
|
|
|
|
$line = $_REQUEST['line'];
|
|
|
|
$location = $_REQUEST['location'];
|
|
|
|
$agent = $_REQUEST['agent'];
|
|
|
|
$stack = $_REQUEST['stack'];
|
|
|
|
|
|
|
|
error_log(
|
|
|
|
"Javascript: $message in $file($line)"
|
|
|
|
."\nLocation: $location"
|
|
|
|
."\nAgent: $agent"
|
|
|
|
."\nUser: $user"
|
|
|
|
."\nStack: $stack"
|
|
|
|
);
|
2016-07-22 20:00:27 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|