refactor(logs): move to core package (#4586)
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
import { logger } from "@homarr/log";
|
||||
import { createLogger } from "@homarr/core/infrastructure/logs";
|
||||
import { ErrorWithMetadata } from "@homarr/core/infrastructure/logs/error";
|
||||
|
||||
import type { IconRepositoryLicense } from "../types/icon-repository-license";
|
||||
import type { RepositoryIconGroup } from "../types/repository-icon-group";
|
||||
|
||||
const logger = createLogger({ module: "iconRepository" });
|
||||
|
||||
export abstract class IconRepository {
|
||||
protected readonly allowedImageFileTypes = [".png", ".svg", ".jpeg"];
|
||||
|
||||
@@ -19,7 +22,9 @@ export abstract class IconRepository {
|
||||
try {
|
||||
return await this.getAllIconsInternalAsync();
|
||||
} catch (err) {
|
||||
logger.error(`Unable to request icons from repository "${this.slug}": ${JSON.stringify(err)}`);
|
||||
logger.error(
|
||||
new ErrorWithMetadata("Unable to request icons from repository", { slug: this.slug }, { cause: err }),
|
||||
);
|
||||
return {
|
||||
success: false,
|
||||
icons: [],
|
||||
|
||||
Reference in New Issue
Block a user