From 89b8e7b2c83d914094b31cd13b843e256afef194 Mon Sep 17 00:00:00 2001 From: LunaUrsa <1836049+LunaUrsa@users.noreply.github.com> Date: Sat, 11 Nov 2023 13:03:05 -0600 Subject: [PATCH] Fix logging --- src/api/apiV2/appeals/appeals.queries.ts | 2 +- src/api/apiV2/drugs/drugs.queries.ts | 2 +- src/api/apiV2/users/users.queries.ts | 2 +- src/discord/api/apiV1/appeals/appealSubmit.queries.ts | 2 +- src/discord/commands/guild/d.ai.ts | 8 ++++---- src/discord/events/autocomplete.ts | 2 +- src/discord/utils/appeal.ts | 2 +- src/global/commands/g.ai.ts | 6 +++--- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/api/apiV2/appeals/appeals.queries.ts b/src/api/apiV2/appeals/appeals.queries.ts index c3b59e2d2..7307d0b25 100644 --- a/src/api/apiV2/appeals/appeals.queries.ts +++ b/src/api/apiV2/appeals/appeals.queries.ts @@ -1,6 +1,6 @@ import { PrismaClient } from '@prisma/client'; -const db = new PrismaClient({ log: ['error', 'info', 'query', 'warn'] }); +const db = new PrismaClient({ log: ['error'] }); const F = f(__filename); export default { diff --git a/src/api/apiV2/drugs/drugs.queries.ts b/src/api/apiV2/drugs/drugs.queries.ts index 6bdd30474..c567034b0 100644 --- a/src/api/apiV2/drugs/drugs.queries.ts +++ b/src/api/apiV2/drugs/drugs.queries.ts @@ -1,6 +1,6 @@ import { PrismaClient } from '@prisma/client'; -const db = new PrismaClient({ log: ['error', 'info', 'query', 'warn'] }); +const db = new PrismaClient({ log: ['error'] }); export default { getAllDrugs() { diff --git a/src/api/apiV2/users/users.queries.ts b/src/api/apiV2/users/users.queries.ts index cbbe7d016..5c4f50eae 100644 --- a/src/api/apiV2/users/users.queries.ts +++ b/src/api/apiV2/users/users.queries.ts @@ -1,6 +1,6 @@ import { PrismaClient } from '@prisma/client'; -const db = new PrismaClient({ log: ['error', 'info', 'query', 'warn'] }); +const db = new PrismaClient({ log: ['error'] }); export default { getAllUsers() { diff --git a/src/discord/api/apiV1/appeals/appealSubmit.queries.ts b/src/discord/api/apiV1/appeals/appealSubmit.queries.ts index d5c361b85..90106ef40 100644 --- a/src/discord/api/apiV1/appeals/appealSubmit.queries.ts +++ b/src/discord/api/apiV1/appeals/appealSubmit.queries.ts @@ -18,7 +18,7 @@ import { PrismaClient, appeal_status, appeals, users, } from '@prisma/client'; -const db = new PrismaClient({ log: ['error', 'info', 'query', 'warn'] }); +const db = new PrismaClient({ log: ['error'] }); const F = f(__filename); diff --git a/src/discord/commands/guild/d.ai.ts b/src/discord/commands/guild/d.ai.ts index cc430e55f..95cdc1561 100644 --- a/src/discord/commands/guild/d.ai.ts +++ b/src/discord/commands/guild/d.ai.ts @@ -47,7 +47,7 @@ import commandContext from '../../utils/context'; import { userInfoEmbed } from '../../../global/commands/g.moderate'; import { sleep } from './d.bottest'; -const db = new PrismaClient({ log: ['error', 'info', 'query', 'warn'] }); +const db = new PrismaClient({ log: ['error'] }); const F = f(__filename); @@ -643,10 +643,10 @@ export async function aiAudit( .join('\n') .slice(0, 1024); - log.debug(F, `messageOutput: ${messageOutput}`); + // log.debug(F, `messageOutput: ${messageOutput}`); const responseOutput = chatResponse.slice(0, 1023); - log.debug(F, `responseOutput: ${responseOutput}`); + // log.debug(F, `responseOutput: ${responseOutput}`); embed.spliceFields( 0, @@ -665,7 +665,7 @@ export async function aiAudit( const promptCost = (promptTokens / 1000) * aiCosts[cleanPersona.ai_model as keyof typeof aiCosts].input; const completionCost = (completionTokens / 1000) * aiCosts[cleanPersona.ai_model as keyof typeof aiCosts].output; - log.debug(F, `promptCost: ${promptCost}, completionCost: ${completionCost}`); + // log.debug(F, `promptCost: ${promptCost}, completionCost: ${completionCost}`); embed.spliceFields( 2, diff --git a/src/discord/events/autocomplete.ts b/src/discord/events/autocomplete.ts index 932883b16..9d694c6e2 100644 --- a/src/discord/events/autocomplete.ts +++ b/src/discord/events/autocomplete.ts @@ -12,7 +12,7 @@ import drugDataTripsit from '../../global/assets/data/drug_db_tripsit.json'; import timezones from '../../global/assets/data/timezones.json'; import unitsOfMeasurement from '../../global/assets/data/units_of_measurement.json'; -const db = new PrismaClient({ log: ['error', 'info', 'query', 'warn'] }); +const db = new PrismaClient({ log: ['error'] }); const F = f(__filename); // eslint-disable-line diff --git a/src/discord/utils/appeal.ts b/src/discord/utils/appeal.ts index fa20989b1..3e4cef943 100644 --- a/src/discord/utils/appeal.ts +++ b/src/discord/utils/appeal.ts @@ -10,7 +10,7 @@ import { PrismaClient, appeal_status, user_action_type, user_actions, } from '@prisma/client'; -const db = new PrismaClient({ log: ['error', 'info', 'query', 'warn'] }); +const db = new PrismaClient({ log: ['error'] }); const F = f(__filename); diff --git a/src/global/commands/g.ai.ts b/src/global/commands/g.ai.ts index 59e6071e1..ce990f174 100644 --- a/src/global/commands/g.ai.ts +++ b/src/global/commands/g.ai.ts @@ -2,7 +2,7 @@ import OpenAI from 'openai'; import { PrismaClient, ai_personas } from '@prisma/client'; import { Moderation } from 'openai/resources'; -const db = new PrismaClient({ log: ['error', 'info', 'query', 'warn'] }); +const db = new PrismaClient({ log: ['error'] }); const F = f(__filename); @@ -326,7 +326,7 @@ export async function aiChat( // function_call: 'auto', } as OpenAI.Chat.CompletionCreateParamsNonStreaming; - log.debug(F, `payload: ${JSON.stringify(payload, null, 2)}`); + // log.debug(F, `payload: ${JSON.stringify(payload, null, 2)}`); let responseMessage = {} as OpenAI.Chat.CreateChatCompletionRequestMessage; const openai = new OpenAI({ organization: 'org-h4Jvunqw3MmHmIgeLHpr1a3Y', @@ -344,7 +344,7 @@ export async function aiChat( throw err; } }); - log.debug(F, `chatCompletion: ${JSON.stringify(chatCompletion, null, 2)}`); + // log.debug(F, `chatCompletion: ${JSON.stringify(chatCompletion, null, 2)}`); if (chatCompletion && chatCompletion.choices[0].message) { responseMessage = chatCompletion.choices[0].message;