Skip to content

Commit

Permalink
Fix: Improve pino logger usage in safe-action.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
arianjinx committed Sep 3, 2024
1 parent d792467 commit 4f4f692
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions apps/app/src/actions/safe-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ export const authActionClient = actionClientWithMeta
const result = await next({ ctx: {} });

if (process.env.NODE_ENV === "development") {
logger("Input ->", clientInput);
logger("Result ->", result.data);
logger("Metadata ->", metadata);
logger.info(`Input -> ${JSON.stringify(clientInput)}`);
logger.info(`Result -> ${JSON.stringify(result.data)}`);
logger.info(`Metadata -> ${JSON.stringify(metadata)}`);

return result;
}
Expand Down
4 changes: 3 additions & 1 deletion packages/logger/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export const logger = require("pino")();
import pino from "pino";

export const logger = pino();

0 comments on commit 4f4f692

Please sign in to comment.