Skip to content

Commit

Permalink
simplified connfig and piped to pino-pretty for dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
GuruUpdesh committed Nov 17, 2024
1 parent 8897d8a commit db1efe2
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 19 deletions.
12 changes: 1 addition & 11 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,7 @@ const config = {
},
experimental: {
instrumentationHook: true,
serverComponentsExternalPackages: ["pino", "pino-pretty"],
},
// resolves client-side module resolution error
// @see https://github.com/pinojs/pino/issues/1841#issuecomment-2244564289
webpack: (config, context) => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
config.externals.push({
"thread-stream": "commonjs thread-stream",
});
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return config;
serverComponentsExternalPackages: ["pino"],
},
};

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"db:push": "dotenv drizzle-kit push:pg",
"db:migrations": "npx drizzle-kit generate:pg",
"db:studio": "dotenv drizzle-kit studio",
"dev": "next dev",
"dev": "next dev | pino-pretty",
"dev:turbo": "next dev --turbo",
"start": "next start",
"lint": "next lint",
Expand Down
7 changes: 0 additions & 7 deletions src/lib/logger.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
import pino from "pino";

export const logger = pino({
transport: {
target: "pino-pretty",
options: {
colorize: true,
},
},
level: "info",

redact: [], // prevent logging of sensitive data
});

0 comments on commit db1efe2

Please sign in to comment.