Skip to content

Commit 4fae73b

Browse files
committed
remove logger.debug
1 parent 540e0be commit 4fae73b

File tree

38 files changed

+2
-307
lines changed

38 files changed

+2
-307
lines changed

apps/sim/app/api/billing/update-cost/route.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ export async function POST(req: NextRequest) {
3333
logger.info(`[${requestId}] Update cost request started`)
3434

3535
if (!isBillingEnabled) {
36-
logger.debug(`[${requestId}] Billing is disabled, skipping cost update`)
3736
return NextResponse.json({
3837
success: true,
3938
message: 'Billing disabled, cost update skipped',

apps/sim/app/api/chat/[identifier]/otp/route.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,6 @@ export async function POST(
117117
const requestId = generateRequestId()
118118

119119
try {
120-
logger.debug(`[${requestId}] Processing OTP request for identifier: ${identifier}`)
121-
122120
const body = await request.json()
123121
const { email } = otpRequestSchema.parse(body)
124122

@@ -211,8 +209,6 @@ export async function PUT(
211209
const requestId = generateRequestId()
212210

213211
try {
214-
logger.debug(`[${requestId}] Verifying OTP for identifier: ${identifier}`)
215-
216212
const body = await request.json()
217213
const { email, otp } = otpVerifySchema.parse(body)
218214

apps/sim/app/api/chat/[identifier]/route.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ export async function POST(
4242
const requestId = generateRequestId()
4343

4444
try {
45-
logger.debug(`[${requestId}] Processing chat request for identifier: ${identifier}`)
46-
4745
let parsedBody
4846
try {
4947
const rawBody = await request.json()
@@ -294,8 +292,6 @@ export async function GET(
294292
const requestId = generateRequestId()
295293

296294
try {
297-
logger.debug(`[${requestId}] Fetching chat info for identifier: ${identifier}`)
298-
299295
const deploymentResult = await db
300296
.select({
301297
id: chat.id,

apps/sim/app/api/creators/route.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,6 @@ export async function POST(request: NextRequest) {
9595
const body = await request.json()
9696
const data = CreateCreatorProfileSchema.parse(body)
9797

98-
logger.debug(`[${requestId}] Creating creator profile:`, {
99-
referenceType: data.referenceType,
100-
referenceId: data.referenceId,
101-
})
102-
10398
// Validate permissions
10499
if (data.referenceType === 'user') {
105100
if (data.referenceId !== session.user.id) {

apps/sim/app/api/form/[identifier]/route.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ export async function POST(
5858
const requestId = generateRequestId()
5959

6060
try {
61-
logger.debug(`[${requestId}] Processing form submission for identifier: ${identifier}`)
62-
6361
let parsedBody
6462
try {
6563
const rawBody = await request.json()
@@ -300,8 +298,6 @@ export async function GET(
300298
const requestId = generateRequestId()
301299

302300
try {
303-
logger.debug(`[${requestId}] Fetching form info for identifier: ${identifier}`)
304-
305301
const deploymentResult = await db
306302
.select({
307303
id: form.id,

apps/sim/app/api/help/route.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ export async function POST(req: NextRequest) {
7777
}
7878
}
7979

80-
logger.debug(`[${requestId}] Help request includes ${images.length} images`)
81-
8280
const userId = session.user.id
8381
let emailText = `
8482
Type: ${type}

apps/sim/app/api/knowledge/search/route.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,6 @@ export async function POST(request: NextRequest) {
186186
valueTo: filter.valueTo,
187187
}
188188
})
189-
190-
logger.debug(`[${requestId}] Processed ${structuredFilters.length} structured filters`)
191189
}
192190

193191
if (accessibleKbIds.length === 0) {
@@ -220,7 +218,6 @@ export async function POST(request: NextRequest) {
220218

221219
if (!hasQuery && hasFilters) {
222220
// Tag-only search without vector similarity
223-
logger.debug(`[${requestId}] Executing tag-only search with filters:`, structuredFilters)
224221
results = await handleTagOnlySearch({
225222
knowledgeBaseIds: accessibleKbIds,
226223
topK: validatedData.topK,
@@ -244,7 +241,6 @@ export async function POST(request: NextRequest) {
244241
})
245242
} else if (hasQuery && !hasFilters) {
246243
// Vector-only search
247-
logger.debug(`[${requestId}] Executing vector-only search`)
248244
const strategy = getQueryStrategy(accessibleKbIds.length, validatedData.topK)
249245
const queryVector = JSON.stringify(await queryEmbeddingPromise)
250246

apps/sim/app/api/knowledge/search/utils.ts

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
import { db } from '@sim/db'
22
import { document, embedding } from '@sim/db/schema'
3-
import { createLogger } from '@sim/logger'
43
import { and, eq, inArray, isNull, sql } from 'drizzle-orm'
54
import type { StructuredFilter } from '@/lib/knowledge/types'
65

7-
const logger = createLogger('KnowledgeSearchUtils')
8-
96
export async function getDocumentNamesByIds(
107
documentIds: string[]
118
): Promise<Record<string, string>> {
@@ -140,17 +137,12 @@ function buildFilterCondition(filter: StructuredFilter, embeddingTable: any) {
140137
const { tagSlot, fieldType, operator, value, valueTo } = filter
141138

142139
if (!isTagSlotKey(tagSlot)) {
143-
logger.debug(`[getStructuredTagFilters] Unknown tag slot: ${tagSlot}`)
144140
return null
145141
}
146142

147143
const column = embeddingTable[tagSlot]
148144
if (!column) return null
149145

150-
logger.debug(
151-
`[getStructuredTagFilters] Processing ${tagSlot} (${fieldType}) ${operator} ${value}`
152-
)
153-
154146
// Handle text operators
155147
if (fieldType === 'text') {
156148
const stringValue = String(value)
@@ -208,7 +200,6 @@ function buildFilterCondition(filter: StructuredFilter, embeddingTable: any) {
208200
const dateStr = String(value)
209201
// Validate YYYY-MM-DD format
210202
if (!/^\d{4}-\d{2}-\d{2}$/.test(dateStr)) {
211-
logger.debug(`[getStructuredTagFilters] Invalid date format: ${dateStr}, expected YYYY-MM-DD`)
212203
return null
213204
}
214205

@@ -287,9 +278,6 @@ function getStructuredTagFilters(filters: StructuredFilter[], embeddingTable: an
287278
conditions.push(slotConditions[0])
288279
} else {
289280
// Multiple conditions for same slot - OR them together
290-
logger.debug(
291-
`[getStructuredTagFilters] OR'ing ${slotConditions.length} conditions for ${slot}`
292-
)
293281
conditions.push(sql`(${sql.join(slotConditions, sql` OR `)})`)
294282
}
295283
}
@@ -380,8 +368,6 @@ export async function handleTagOnlySearch(params: SearchParams): Promise<SearchR
380368
throw new Error('Tag filters are required for tag-only search')
381369
}
382370

383-
logger.debug(`[handleTagOnlySearch] Executing tag-only search with filters:`, structuredFilters)
384-
385371
const strategy = getQueryStrategy(knowledgeBaseIds.length, topK)
386372
const tagFilterConditions = getStructuredTagFilters(structuredFilters, embedding)
387373

@@ -431,8 +417,6 @@ export async function handleVectorOnlySearch(params: SearchParams): Promise<Sear
431417
throw new Error('Query vector and distance threshold are required for vector-only search')
432418
}
433419

434-
logger.debug(`[handleVectorOnlySearch] Executing vector-only search`)
435-
436420
const strategy = getQueryStrategy(knowledgeBaseIds.length, topK)
437421

438422
const distanceExpr = sql<number>`${embedding.embedding} <=> ${queryVector}::vector`.as('distance')
@@ -489,23 +473,13 @@ export async function handleTagAndVectorSearch(params: SearchParams): Promise<Se
489473
throw new Error('Query vector and distance threshold are required for tag and vector search')
490474
}
491475

492-
logger.debug(
493-
`[handleTagAndVectorSearch] Executing tag + vector search with filters:`,
494-
structuredFilters
495-
)
496-
497476
// Step 1: Filter by tags first
498477
const tagFilteredIds = await executeTagFilterQuery(knowledgeBaseIds, structuredFilters)
499478

500479
if (tagFilteredIds.length === 0) {
501-
logger.debug(`[handleTagAndVectorSearch] No results found after tag filtering`)
502480
return []
503481
}
504482

505-
logger.debug(
506-
`[handleTagAndVectorSearch] Found ${tagFilteredIds.length} results after tag filtering`
507-
)
508-
509483
// Step 2: Perform vector search only on tag-filtered results
510484
return await executeVectorSearchOnIds(
511485
tagFilteredIds.map((r) => r.id),

apps/sim/app/api/logs/execution/[executionId]/route.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ export async function GET(
3434

3535
const authenticatedUserId = authResult.userId
3636

37-
logger.debug(
38-
`[${requestId}] Fetching execution data for: ${executionId} (auth: ${authResult.authType})`
39-
)
40-
4137
const [workflowLog] = await db
4238
.select({
4339
id: workflowExecutionLogs.id,
@@ -125,11 +121,6 @@ export async function GET(
125121
},
126122
}
127123

128-
logger.debug(`[${requestId}] Successfully fetched execution data for: ${executionId}`)
129-
logger.debug(
130-
`[${requestId}] Workflow state contains ${Object.keys((snapshot.stateData as any)?.blocks || {}).length} blocks`
131-
)
132-
133124
return NextResponse.json(response)
134125
} catch (error) {
135126
logger.error(`[${requestId}] Error fetching execution data:`, error)

apps/sim/app/api/mcp/servers/test-connection/route.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,7 @@ export const POST = withMcpAuth('write')(
172172
if (client) {
173173
try {
174174
await client.disconnect()
175-
} catch (disconnectError) {
176-
logger.debug(`[${requestId}] Test client disconnect error (expected):`, disconnectError)
177-
}
175+
} catch (disconnectError) {}
178176
}
179177
}
180178

0 commit comments

Comments
 (0)