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:
Joakim Jäderberg
2025-07-03 12:37:04 +00:00
parent 7e32ed294d
commit daf765f3d5
110 changed files with 681 additions and 441 deletions

View File

@@ -1,5 +1,7 @@
// https://docs.lokalise.com/en/articles/3229161-structured-json
import { logger } from "@scandic-hotels/common/logger"
import type { LokaliseMessageDescriptor } from "@/types/intl"
type TranslationEntry = {
@@ -28,7 +30,7 @@ export function format(
if (description) {
if (typeof description === "string") {
console.warn(
logger.warn(
`Unsupported type for description, expected 'object', got ${typeof context}. Skipping!`,
msg
)
@@ -39,7 +41,7 @@ export function format(
if (typeof context === "string") {
entry.context = context
} else {
console.warn(
logger.warn(
`Unsupported type for context, expected 'string', got ${typeof context}`,
msg
)
@@ -50,7 +52,7 @@ export function format(
if (limit && typeof limit === "number") {
entry.limit = limit
} else {
console.warn(
logger.warn(
`Unsupported type for limit, expected 'number', got ${typeof limit}`,
msg
)
@@ -64,7 +66,7 @@ export function format(
entry.tags = tagArray
}
} else {
console.warn(
logger.warn(
`Unsupported type for tags, expected Array, got ${typeof tags}`,
msg
)
@@ -75,7 +77,7 @@ export function format(
results[id] = entry
} else {
console.warn(
logger.warn(
`Skipping message, unsupported type for defaultMessage, expected string, got ${typeof defaultMessage}`,
{
id,