Merged in feature/wrap-logging (pull request #2511)
Feature/wrap logging * feat: change all logging to go through our own logger function so that we can control log levels * move packages/trpc to using our own logger * merge Approved-by: Linus Flood
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { Lang } from "@scandic-hotels/common/constants/language"
|
||||
import { createLogger } from "@scandic-hotels/common/logger/createLogger"
|
||||
import { getServiceToken } from "@scandic-hotels/common/tokenManager"
|
||||
import { safeTry } from "@scandic-hotels/common/utils/safeTry"
|
||||
import {
|
||||
@@ -10,6 +11,7 @@ import type { WarmupFunction, WarmupResult } from "."
|
||||
|
||||
export const warmupHotelIdsByCountry =
|
||||
(): WarmupFunction => async (): Promise<WarmupResult> => {
|
||||
const warmupLogger = createLogger("warmupHotelIdsByCountry")
|
||||
try {
|
||||
let serviceToken = await getServiceToken()
|
||||
|
||||
@@ -39,7 +41,7 @@ export const warmupHotelIdsByCountry =
|
||||
)
|
||||
|
||||
if (error) {
|
||||
console.error(
|
||||
warmupLogger.error(
|
||||
`[Warmup]: Error fetching hotel IDs for ${countryName}:`,
|
||||
error
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user