basic setup with yoga + pothos and pino logger
This commit is contained in:
parent
f8a16a9fce
commit
6312b344cd
7 changed files with 52 additions and 10 deletions
19
lib/logger/index.ts
Normal file
19
lib/logger/index.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import { type YogaLogger } from "graphql-yoga";
|
||||
import pino from "pino";
|
||||
|
||||
export const logger = pino();
|
||||
|
||||
export const yogaLogger: YogaLogger = {
|
||||
debug(...args) {
|
||||
logger.debug("", ...args);
|
||||
},
|
||||
info(...args) {
|
||||
logger.info("", ...args);
|
||||
},
|
||||
warn(...args) {
|
||||
logger.warn("", ...args);
|
||||
},
|
||||
error(...args) {
|
||||
logger.error("", ...args);
|
||||
},
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue