Skip to content

Commit 67b0831

Browse files
committed
feat use sim logger rather than console log
1 parent adc7986 commit 67b0831

File tree

1 file changed

+3
-6
lines changed
  • apps/sim/app/api/tools/command/exec

1 file changed

+3
-6
lines changed

apps/sim/app/api/tools/command/exec/route.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
import { createLogger } from '@sim/logger'
12
import { spawn } from "child_process";
23
import { NextRequest, NextResponse } from "next/server";
34
import type { CommandInput, CommandOutput } from "@/tools/command/types";
4-
55
import { getSession } from '@/lib/auth'
66

7+
const logger = createLogger('CommandExecAPI')
8+
79
export async function POST(request: NextRequest) {
810
try {
911
const session = await getSession()
@@ -75,11 +77,6 @@ import { validatePathSegment } from '@/lib/core/security/input-validation'
7577

7678
return NextResponse.json(output);
7779
} catch (error) {
78-
import { createLogger } from '@sim/logger'
79-
80-
const logger = createLogger('CommandExecAPI')
81-
82-
// Then replace console.error with:
8380
logger.error('Command execution error:', { error })
8481
return NextResponse.json(
8582
{

0 commit comments

Comments
 (0)