Skip to content

Commit aa0a33e

Browse files
Revert "feat(traceroot): add traceroot logger" (#1434)
This reverts commit 6d1b172.
1 parent 603b547 commit aa0a33e

File tree

6 files changed

+217
-923
lines changed

6 files changed

+217
-923
lines changed

apps/sim/lib/logs/console/logger.test.ts

Lines changed: 0 additions & 46 deletions
This file was deleted.

apps/sim/lib/logs/console/logger.ts

Lines changed: 4 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,10 @@
33
*
44
* This module provides standardized console logging utilities for internal application logging.
55
* It is separate from the user-facing logging system in logging.ts.
6-
*
7-
* For Node.js runtime, uses TraceRoot logger for enhanced logging with trace correlation.
8-
* For Edge runtime, falls back to console logging to avoid import errors.
96
*/
107
import chalk from 'chalk'
118
import { env } from '@/lib/env'
129

13-
// Runtime detection - check if we're in Edge runtime
14-
const isEdgeRuntime = () => {
15-
return (
16-
typeof window !== 'undefined' ||
17-
(typeof globalThis !== 'undefined' && 'EdgeRuntime' in globalThis) ||
18-
typeof process === 'undefined' ||
19-
(typeof process !== 'undefined' && process.env.NEXT_RUNTIME === 'edge')
20-
)
21-
}
22-
23-
// Conditional TraceRoot import - only in Node runtime
24-
let traceRootLogger: any = null
25-
26-
if (!isEdgeRuntime()) {
27-
try {
28-
const traceRoot = require('traceroot-sdk-ts')
29-
traceRootLogger = traceRoot.getLogger
30-
} catch (importError) {
31-
console.warn('TraceRoot SDK not available, falling back to console logging')
32-
}
33-
}
34-
3510
/**
3611
* LogLevel enum defines the severity levels for logging
3712
*
@@ -133,29 +108,16 @@ const formatObject = (obj: any): string => {
133108
*
134109
* This class provides methods for logging at different severity levels
135110
* and handles formatting, colorization, and environment-specific behavior.
136-
* Uses TraceRoot logger in Node runtime and falls back to console logging in Edge runtime.
137111
*/
138112
export class Logger {
139113
private module: string
140-
private traceRootLoggerInstance: any = null
141114

142115
/**
143116
* Create a new logger for a specific module
144117
* @param module The name of the module (e.g., 'OpenAIProvider', 'AgentBlockHandler')
145118
*/
146119
constructor(module: string) {
147120
this.module = module
148-
149-
// Initialize TraceRoot logger instance if available
150-
if (traceRootLogger) {
151-
try {
152-
this.traceRootLoggerInstance = traceRootLogger(module)
153-
} catch (error) {
154-
console.warn(
155-
`Failed to create TraceRoot logger for module ${module}, falling back to console logging`
156-
)
157-
}
158-
}
159121
}
160122

161123
/**
@@ -262,11 +224,7 @@ export class Logger {
262224
* @param args Additional arguments to log
263225
*/
264226
debug(message: string, ...args: any[]) {
265-
if (this.traceRootLoggerInstance) {
266-
this.traceRootLoggerInstance.debug(message, ...args)
267-
} else {
268-
this.log(LogLevel.DEBUG, message, ...args)
269-
}
227+
this.log(LogLevel.DEBUG, message, ...args)
270228
}
271229

272230
/**
@@ -284,11 +242,7 @@ export class Logger {
284242
* @param args Additional arguments to log
285243
*/
286244
info(message: string, ...args: any[]) {
287-
if (this.traceRootLoggerInstance) {
288-
this.traceRootLoggerInstance.info(message, ...args)
289-
} else {
290-
this.log(LogLevel.INFO, message, ...args)
291-
}
245+
this.log(LogLevel.INFO, message, ...args)
292246
}
293247

294248
/**
@@ -305,11 +259,7 @@ export class Logger {
305259
* @param args Additional arguments to log
306260
*/
307261
warn(message: string, ...args: any[]) {
308-
if (this.traceRootLoggerInstance) {
309-
this.traceRootLoggerInstance.warn(message, ...args)
310-
} else {
311-
this.log(LogLevel.WARN, message, ...args)
312-
}
262+
this.log(LogLevel.WARN, message, ...args)
313263
}
314264

315265
/**
@@ -326,11 +276,7 @@ export class Logger {
326276
* @param args Additional arguments to log
327277
*/
328278
error(message: string, ...args: any[]) {
329-
if (this.traceRootLoggerInstance) {
330-
this.traceRootLoggerInstance.error(message, ...args)
331-
} else {
332-
this.log(LogLevel.ERROR, message, ...args)
333-
}
279+
this.log(LogLevel.ERROR, message, ...args)
334280
}
335281
}
336282

apps/sim/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@
125125
"tailwind-merge": "^2.6.0",
126126
"tailwindcss-animate": "^1.0.7",
127127
"three": "0.177.0",
128-
"traceroot-sdk-ts": "0.0.1-alpha.33",
129128
"uuid": "^11.1.0",
130129
"xlsx": "0.18.5",
131130
"zod": "^3.24.2"

apps/sim/traceroot.config.ts

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)