Skip to content

Commit

Permalink
feat: defaultMeta can now be passed through
Browse files Browse the repository at this point in the history
  • Loading branch information
ImLunaHey committed Oct 7, 2023
1 parent 04b5e22 commit fffb1e0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export type BaseSchema = {
type Options<Schema extends BaseSchema> = {
service: string;
schema?: Schema;
defaultMeta?: Record<string, unknown>;
}

type MetaForSchema<Schema extends BaseSchema, Level extends keyof Schema, Message> =
Expand Down Expand Up @@ -86,6 +87,7 @@ export class Logger<Schema extends BaseSchema> {
format.json()
),
defaultMeta: {
...(options.defaultMeta ?? {}),
name: pkg.name,
pid: process.pid,
commitHash: getCommitHash(),
Expand Down

0 comments on commit fffb1e0

Please sign in to comment.