Skip to content

Commit

Permalink
Fix logging
Browse files Browse the repository at this point in the history
  • Loading branch information
LunaUrsa committed Nov 11, 2023
1 parent 4af2cbb commit 89b8e7b
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/api/apiV2/appeals/appeals.queries.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/api/apiV2/drugs/drugs.queries.ts
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion src/api/apiV2/users/users.queries.ts
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion src/discord/api/apiV1/appeals/appealSubmit.queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
8 changes: 4 additions & 4 deletions src/discord/commands/guild/d.ai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/discord/events/autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/discord/utils/appeal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
6 changes: 3 additions & 3 deletions src/global/commands/g.ai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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',
Expand All @@ -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;
Expand Down

0 comments on commit 89b8e7b

Please sign in to comment.