英文:
In T3 Stack project, I'm getting query logs in console of browser, How can I stop it?
问题
我有一个T3堆栈项目,我正在使用trpc和prisma获取数据,但它在浏览器控制台中显示日志。我该如何停止这些日志?
英文:
I have T3 stack project and I'm fetching data using trpc and prisma, but It's showing logs in browsers console.
How can I stop this logs?
答案1
得分: 0
你可能在配置中启用了loggerLink
,只需检查并传递enabled: () => false
来禁用它,或者完全删除它。
export const trpc = createTRPCNext<AppRouter>({
config() {
return {
links: [
loggerLink({
// 在这里使用任何你想要的条件
enabled: (opts) => false,
}),
],
};
},
});
英文:
You probably have loggerLink
enabled in your config, just check for it and pass enabled: () => false
if you want to disable it, or just remove it completely.
export const trpc = createTRPCNext<AppRouter>({
config() {
return {
links: [
loggerLink({
// Use whatever condition you want here
enabled: (opts) => false,
}),
],
};
},
});
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论