diff --git a/adonis-typings/logger.ts b/adonis-typings/logger.ts index f50ac93..e87b0e5 100644 --- a/adonis-typings/logger.ts +++ b/adonis-typings/logger.ts @@ -35,7 +35,7 @@ declare module '@ioc:Adonis/Core/Logger' { /** * Config shape */ - export type LoggerConfigContract = { + export type LoggerConfig = { name: string, level: Level | 'silent' | string, enabled: boolean, diff --git a/package-lock.json b/package-lock.json index 2519e47..d4fc94e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6949,11 +6949,6 @@ "integrity": "sha512-tdzBRDGWcI1OpPVmChbdSKhvSVurznZ8X36AYURAcl+0o2ldlCY2XPzyXNNxwJwwyIU+rIglTCG4kxtNKBQH7Q==", "dev": true }, - "ts-essentials": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/ts-essentials/-/ts-essentials-6.0.4.tgz", - "integrity": "sha512-ZtU9zgSnn8DcAxDZY1DJF8rnxsen8M0IVkO7dVB5fTEOVs7o/0RA4V6i99PIg99bpX81Sgb0FCLjQqD5Ufz3rQ==" - }, "ts-node": { "version": "8.8.2", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.8.2.tgz", diff --git a/package.json b/package.json index 4e30686..5659b4c 100644 --- a/package.json +++ b/package.json @@ -79,8 +79,7 @@ "dependencies": { "@types/pino": "^5.17.0", "abstract-logging": "^2.0.0", - "pino": "^6.1.1", - "ts-essentials": "^6.0.4" + "pino": "^6.1.1" }, "directories": { "doc": "docs", diff --git a/src/FakeLogger.ts b/src/FakeLogger.ts index 4ab2898..a74993d 100644 --- a/src/FakeLogger.ts +++ b/src/FakeLogger.ts @@ -13,8 +13,7 @@ /// import Pino from 'pino' -import { DeepReadonly } from 'ts-essentials' -import { LoggerConfigContract } from '@ioc:Adonis/Core/Logger' +import { LoggerConfig } from '@ioc:Adonis/Core/Logger' import { Logger } from './Logger' @@ -23,7 +22,7 @@ import { Logger } from './Logger' * the log messages as an array vs writing them to `stdout`. */ export class FakeLogger extends Logger { - constructor (config: DeepReadonly, pino?: Pino.Logger) { + constructor (config: LoggerConfig, pino?: Pino.Logger) { /** * Config is only used when we are not receiving an * existing instance of pino. diff --git a/src/Logger.ts b/src/Logger.ts index fc75de6..37c67e9 100644 --- a/src/Logger.ts +++ b/src/Logger.ts @@ -14,9 +14,8 @@ /// import Pino from 'pino' -import { DeepReadonly } from 'ts-essentials' import abstractLogging from 'abstract-logging' -import { LoggerConfigContract, LoggerContract } from '@ioc:Adonis/Core/Logger' +import { LoggerConfig, LoggerContract } from '@ioc:Adonis/Core/Logger' import { getPino } from './getPino' @@ -48,7 +47,7 @@ export class Logger implements LoggerContract { public pino: Pino.Logger constructor ( - protected $config: DeepReadonly, + protected $config: LoggerConfig, pino?: Pino.Logger, ) { if (!this.$config.enabled) { diff --git a/src/getPino.ts b/src/getPino.ts index 432cd2d..3d2b864 100644 --- a/src/getPino.ts +++ b/src/getPino.ts @@ -14,13 +14,12 @@ /// import Pino from 'pino' -import { DeepReadonly } from 'ts-essentials' -import { LoggerConfigContract } from '@ioc:Adonis/Core/Logger' +import { LoggerConfig } from '@ioc:Adonis/Core/Logger' /** * Returns an instance of pino logger by adjusting the config options */ -export function getPino (options: DeepReadonly): Pino.Logger { +export function getPino (options: LoggerConfig): Pino.Logger { const pinoOptions = Object.assign({}, options) return options.stream ? Pino(pinoOptions as any, options.stream) : Pino(pinoOptions as any) }