Jacek Kowalski
2019-02-19 e654e6660d8413231787d2b98961cbf4fc4442c7
Increase logging in ignore/replace situations
1 files modified
3 ■■■■■ changed files
parse.php 3 ●●●●● patch | view | raw | blame | history
parse.php
@@ -60,8 +60,10 @@
                if((int)substr($vehicle['num'], 2) != (int)$dbVehicle['num']) {
                    if($weight > $dbVehicle['weight']) {
                        $replace += 1;
                        $logger->warn($vehicle['num'].' voting to replace '.$dbVehicle['num'].' (same ID: '.$id.')');
                    } else {
                        $ignore += 1;
                        $logger->warn($vehicle['num'].' voting to ignore '.$dbVehicle['num'].' (same ID: '.$id.')');
                    }
                }
                continue;
@@ -70,6 +72,7 @@
            $dbVehicle = $db->getByNum($vehicle['num']);
            if($dbVehicle && $dbVehicle['id'] != $id) {
                $replace += 1;
                $logger->warn($vehicle['id'].' voting to replace '.$dbVehicle['id'].' (same num: '.$vehicle['num'].')');
            }
        }
        $logger->info('Weight: '.$weight.', ignore: '.$ignore.', replace: '.$replace);