From 167e913617531e6584d81aebf0ace8a024a1d5b1 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Fri, 14 Oct 2022 16:27:06 +0100 Subject: [PATCH] fix: pause logging --- src/server/plugins/axiom.ts | 38 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/src/server/plugins/axiom.ts b/src/server/plugins/axiom.ts index e68b82cb..3060aa72 100644 --- a/src/server/plugins/axiom.ts +++ b/src/server/plugins/axiom.ts @@ -1,22 +1,20 @@ -const config = useRuntimeConfig() -const baseURL = `https://cloud.axiom.co/api/v1/datasets/${config.axiom.dataset}/ingest` +// const config = useRuntimeConfig() +// const baseURL = `https://cloud.axiom.co/api/v1/datasets/${config.axiom.dataset}/ingest` export default defineNitroPlugin(() => { - if (process.dev) { - return - } - for (const name of ['log', 'warn', 'error', 'info']) { - const original = console[name] - console[name] = (arg: any, ...args: any[]) => { - $fetch(baseURL, { - method: 'POST', - body: [ - { name, message: arg, args, timestamp: new Date().toISOString() }, - ], - headers: { - Authorization: `Bearer ${config.axiom.accessKey}`, - }, - }) - original(...args) - } - } + // if (process.dev) { + // return + // } + // for (const name of ['log', 'warn', 'error', 'info']) { + // const original = console[name] + // console[name] = (arg: any, ...args: any[]) => { + // $fetch(baseURL, { + // method: 'POST', + // body: [ + // { name, message: arg, args, timestamp: new Date().toISOString() }, + // ], + // headers: { Authorization: `Bearer ${config.axiom.accessKey}` }, + // }) + // original(...args) + // } + // } }) -- knotmirror 0.0.1