Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/server/utils/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ export const logger = LEVELS.reduce(
acc[level] = (namespace: string, ...args: unknown[]) => {
if (LEVELS.indexOf(LOG_LEVEL) < LEVELS.indexOf(level)) return;
CONSOLE_LEVELS[level](
`${CONSOLE_COLORS[level]}${level.toUpperCase()} [${namespace}]`,
"\x1b[0m",
`${CONSOLE_COLORS[level]}${level.toUpperCase()} [${namespace}]\x1b[0m`,
...args.map((e) => (e instanceof Error ? ["\n", e] : [e])).flat(),
);
};
Expand Down
7 changes: 3 additions & 4 deletions src/server/utils/translation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,10 @@ export const getClosestLanguage = (
export const dynamicImportTranslationFiles = async (
path: string,
): Promise<TranslationRecord> => {
const files = await readdir(join(path, "locales")).catch((e) => {
const files = await readdir(join(path, "locales")).catch(() => {
logger.debug(
"translation",
`Error reading translation directory at path "${path}":`,
e,
`No "locales" directory found at path "${path}". Skipping translation.`,
);
return [];
});
Expand All @@ -64,7 +63,7 @@ export const dynamicImportTranslationFiles = async (
if (typeof translation === "object" && translation !== null) {
translations[lang] = translation;
} else {
logger.debug(
logger.warn(
"translation",
`Translation file for language "${lang}" at path "${path}" does not export an object.`,
);
Expand Down
Loading