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

@@ -2,6 +2,7 @@ import { google } from 'googleapis'
import { getBaseURL } from '../helpers/url'
import { Booking } from '../db/booking'
import { getDays } from '../helpers/date'
import { log } from '../helpers/log'
const calendarId = process.env.GOOGLE_CALENDAR_ID
let credentials: object
@@ -9,7 +10,7 @@ let credentials: object
try {
credentials = JSON.parse(process.env.GOOGLE_SERVICE_ACCOUNT_KEY_JSON)
} catch (error) {
console.error(
log.error(
'Unable to parse process.env.GOOGLE_SERVICE_ACCOUNT_KEY_JSON - invalid JSON?'
)
throw error