improve logging?

This commit is contained in:
Thomas Ruoff
2022-06-23 21:36:43 +02:00
committed by Thomas Ruoff
parent 942066bc7a
commit 00002a62d2
15 changed files with 91 additions and 50 deletions

View File

@@ -6,6 +6,7 @@ import { Booking } from '../../../../db/booking'
import { BILL_STATUS, MILAGE_TARIFS } from '../../../../db/enums'
import { getMilageMax } from '../../../../db/index'
import { daysFormatFrontend } from '../../../../helpers/date'
import { log } from '../../../../helpers/log'
import { getBillTotal, createBill, patchBill } from '../../../../helpers/bill'
import { getBookingStatus } from '../../../../helpers/booking'
import { getServerSideBooking } from '../../../../lib/getServerSideProps'
@@ -109,7 +110,7 @@ function BookingBillPage({
setBooking(booking)
} catch (error) {
setStoringError('Buchung konnte nicht gespeichert werden!')
console.error('Failed to store booking', error)
log.error('Failed to store booking', error)
}
setStoringInProgress(false)
}
@@ -197,9 +198,8 @@ function BookingBillPage({
>
-
</button>
<label className="flabel inline">{`Kostenpunkt ${
index + 1
}`}</label>
<label className="flabel inline">{`Kostenpunkt ${index + 1
}`}</label>
</div>
<div className="ml-10 mb-3" key={`input{index}`}>
<Input

View File

@@ -7,6 +7,7 @@ import { getServerSideBooking } from '../../../../lib/getServerSideProps'
import { Booking } from '../../../../db/booking'
import { getBookingStatus, patchBooking } from '../../../../helpers/booking'
import { daysFormatFrontend } from '../../../../helpers/date'
import { log } from '../../../../helpers/log'
import { BOOKING_STATUS } from '../../../../db/enums'
export const getServerSideProps = getServerSideBooking
@@ -30,7 +31,7 @@ function ShowBookingAdmin({ booking: bookingProp }: { booking: Booking }) {
setBooking(updatedBooking)
} catch (error) {
setStoringBookingError('Buchung konnte nicht gespeichert werden.')
console.error('Failed to store booking', error)
log.error('Failed to store booking', error)
}
setStoringBooking(false)
}