Skip to content

Commit 0b5a53d

Browse files
committed
Remove unnecessary comments
1 parent 7fe867b commit 0b5a53d

File tree

4 files changed

+2
-11
lines changed

4 files changed

+2
-11
lines changed

src/Logger.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,13 +178,11 @@ class Logger {
178178
// Filter on level before making a record
179179
if (level < this.getEffectiveLevel()) return "";
180180

181-
// 🌟 Open a span, linking it to a parent if provided
182181
const spanId = openSpan(msg?.toString() || 'Log Event', parentSpanId);
183182

184183
const record = this.makeRecord(msg, data, level);
185184
this.callHandlers(record, level, format);
186185

187-
// 🌟 Close the span
188186
closeSpan(spanId);
189187
return spanId
190188
}

src/bin/SpanTree.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ const sortSpans = (spans: Span[], mode: string): Span[] => {
4646

4747
return rootSpans;
4848
} else {
49-
// ✅ Time Mode: Flatten spans and sort only by `startTime`
5049
return spans
5150
.map(span => new Span(span.name, span.parentSpanId)) // Convert to Span instances
5251
.sort((a, b) => a.startTime - b.startTime); // Sort purely by start time

src/lib/span.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export class Span {
3232
endTime: this.endTime,
3333
parentSpanId: this.parentSpanId,
3434
isCompleted: this.isCompleted(),
35-
children: this.children.map(child => child.toJSON()) // Serialize children
35+
children: this.children.map(child => child.toJSON())
3636
};
3737
}
3838
}

src/lib/tracingManager.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import fs from "fs";
33

44
const SPAN_FILE = "spans.json";
55

6-
// Store all active spans in a dictionary
76
const activeSpans: Record<string, Span> = {};
87

98
/**
@@ -52,11 +51,6 @@ export function closeSpan(spanId: string): Span | null {
5251
* Retrieves all active spans.
5352
* @returns An array of active spans.
5453
*/
55-
// export function getActiveSpans(): Span[] {
56-
// console.log("Checking Active Spans at Time:", Date.now());
57-
// console.log("Stored Active Spans:", Object.values(activeSpans));
58-
// return Object.values(activeSpans);
59-
// }
6054

6155
export function getActiveSpans(): Span[] {
6256
console.log("Checking Active Spans at Time:", Date.now());
@@ -96,7 +90,7 @@ export function getTraceJSON(): string {
9690
console.log("Debug: Active Spans Before JSON Conversion:", activeSpans);
9791

9892
return JSON.stringify(
99-
activeSpans.map(span => span.toJSON()), // ✅ `toJSON()` will now work correctly
93+
activeSpans.map(span => span.toJSON()),
10094
null,
10195
2
10296
);

0 commit comments

Comments
 (0)