Skip to content

Commit

Permalink
Disable excessive logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Arilith committed Nov 28, 2024
1 parent 4108eb3 commit c8fa07b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/Models/StopUpdateCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export class StopUpdateCollection extends Collection<RitInfoStopUpdate> {
* @param fixDeparture Whether the departure time should be fixed
*/
private fixStopTime(previousStop: RitInfoStopUpdate, currentStop: RitInfoStopUpdate, fixArrival: boolean, fixDeparture: boolean) {
console.info(`[StopUpdateCollection] Fixing stop times for stop ${currentStop.stopId}: ${currentStop.name} [${currentStop.sequence}]`)
//console.info(`[StopUpdateCollection] Fixing stop times for stop ${currentStop.stopId}: ${currentStop.name} [${currentStop.sequence}]`)

if(fixArrival)
this.fixArrivalTime(previousStop, currentStop);
Expand Down Expand Up @@ -170,13 +170,13 @@ export class StopUpdateCollection extends Collection<RitInfoStopUpdate> {
stopToFix.departureTime = stopToFix.arrivalTime + stopToFix.departureDelay;

//Log what was fixed, the original stop time, the new arrival time, the new departure time and the delay.
console.info(`[StopUpdateCollection] Fixed stop ${stopToFix.stopId}: ${stopToFix.name} [${stopToFix.sequence}] Arrival time: ${new Date(stopToFix.arrivalTime * 1000)} Departure time: ${new Date(stopToFix.departureTime * 1000)} Original stop time: ${orignalStopTime} seconds. Arrival delay: ${stopToFix.arrivalDelay} seconds. Departure delay: ${stopToFix.departureDelay} seconds.`);
//console.info(`[StopUpdateCollection] Fixed stop ${stopToFix.stopId}: ${stopToFix.name} [${stopToFix.sequence}] Arrival time: ${new Date(stopToFix.arrivalTime * 1000)} Departure time: ${new Date(stopToFix.departureTime * 1000)} Original stop time: ${orignalStopTime} seconds. Arrival delay: ${stopToFix.arrivalDelay} seconds. Departure delay: ${stopToFix.departureDelay} seconds.`);
}
//If there is no delay, we can just set the departure time to the planned departure time.
else {
stopToFix.departureTime = stopToFix.plannedDepartureTime.getTime() / 1000;
//Log what was fixed, the original stop time, the new arrival time, the new departure time and the delay.
console.info(`[StopUpdateCollection] Fixed stop ${stopToFix.stopId}: ${stopToFix.name} [${stopToFix.sequence}] Arrival time: ${new Date(stopToFix.arrivalTime * 1000)} Departure time: ${new Date(stopToFix.departureTime * 1000)} Original stop time: ${orignalStopTime} seconds. Arrival delay: ${stopToFix.arrivalDelay} seconds. Departure delay: ${stopToFix.departureDelay} seconds.`);
//console.info(`[StopUpdateCollection] Fixed stop ${stopToFix.stopId}: ${stopToFix.name} [${stopToFix.sequence}] Arrival time: ${new Date(stopToFix.arrivalTime * 1000)} Departure time: ${new Date(stopToFix.departureTime * 1000)} Original stop time: ${orignalStopTime} seconds. Arrival delay: ${stopToFix.arrivalDelay} seconds. Departure delay: ${stopToFix.departureDelay} seconds.`);
}

}
Expand Down
2 changes: 1 addition & 1 deletion src/Models/TrainUpdateCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class TrainUpdateCollection extends Collection<FeedEntity> {
//We do this so we can check if this update is there the next iteration as well, if not, we add a new stop time update
//that cancels the trip.
if(trainUpdate.hasCustomTripId && !this.TrainUpdatesWithCustomTripId.find(u => u.trip.tripId == trainUpdate.trip.tripId)) {
console.log(`[TrainUpdateCollection] Adding ${trainUpdate.trip.tripId} to TrainUpdatesWithCustomTripId array.`)
// console.log(`[TrainUpdateCollection] Adding ${trainUpdate.trip.tripId} to TrainUpdatesWithCustomTripId array.`)
this.TrainUpdatesWithCustomTripId.push(trainUpdate);
}

Expand Down

0 comments on commit c8fa07b

Please sign in to comment.