refactor(logs): move to core package (#4586)
This commit is contained in:
@@ -24,8 +24,8 @@
|
||||
"prettier": "@homarr/prettier-config",
|
||||
"dependencies": {
|
||||
"@homarr/common": "workspace:^0.1.0",
|
||||
"@homarr/db": "workspace:^0.1.0",
|
||||
"@homarr/log": "workspace:^0.1.0"
|
||||
"@homarr/core": "workspace:^0.1.0",
|
||||
"@homarr/db": "workspace:^0.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@homarr/eslint-config": "workspace:^0.2.0",
|
||||
|
||||
@@ -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