Many many more improvements

This commit is contained in:
2024-12-28 19:21:15 +01:00
parent bd3bf6f580
commit 918f5141fc
27 changed files with 178 additions and 191 deletions

View File

@ -1,9 +1,11 @@
import { EntityManager } from '@mikro-orm/core'
import Database from '#application/database'
import { appLogger } from '#application/logger'
import { Logger } from '#application/logger'
export abstract class BaseEntity {
protected readonly logger: Logger = new Logger('entity')
private getEntityManager(): EntityManager {
return Database.getEntityManager()
}
@ -35,7 +37,7 @@ export abstract class BaseEntity {
throw error
}
} catch (error) {
appLogger.error(`Failed to ${actionDescription}: ${error instanceof Error ? error.message : String(error)}`)
this.logger.error(`Failed to ${actionDescription}: ${error instanceof Error ? error.message : String(error)}`)
throw error
}
}