Skip to content

Commit

Permalink
perf: remove the ILevel interface
Browse files Browse the repository at this point in the history
  • Loading branch information
vansergen committed Aug 21, 2022
1 parent 09f5140 commit 821f2dd
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,14 @@ import pino, {
Logger as PinoLogger,
LoggerOptions as PinoLoggerOptions,
DestinationStream,
Level,
} from "pino";

export interface LoggerOptions extends PinoLoggerOptions {
destination?: DestinationStream;
logger?: PinoLogger;
}

export type ILevel =
| "debug"
| "error"
| "fatal"
| "info"
| "silent"
| "trace"
| "warn";

const serializers = {
error: stdSerializers.err,
request: stdSerializers.req,
Expand Down Expand Up @@ -67,7 +59,7 @@ export class Logger {
return "BINDEN_LOG_LEVEL";
}

public static getLevel(env_name = this.ENV_VARIABLE_NAME): ILevel {
public static getLevel(env_name = this.ENV_VARIABLE_NAME): Level | "silent" {
const {
env: { [env_name]: LEVEL },
} = process;
Expand Down

0 comments on commit 821f2dd

Please sign in to comment.