Rocky_Mountain_Vending/.pnpm-store/v10/files/8d/4685a3b73870b02e074fc35acc3318c68489f0dc17cc2a2b96294a2915b0480944e43cad390dc446efc25516501a6bdf9e60abdf542bc6c67970ab42a57a13
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

57 lines
1.7 KiB
Text

import { DEBUG_BUILD } from '../debug-build.js';
import { debug } from '../utils/debug-logger.js';
import { spanToJSON, getRootSpan, spanIsSampled } from '../utils/spanUtils.js';
/**
* Print a log message for a started span.
*/
function logSpanStart(span) {
if (!DEBUG_BUILD) return;
const { description = '< unknown name >', op = '< unknown op >', parent_span_id: parentSpanId } = spanToJSON(span);
const { spanId } = span.spanContext();
const sampled = spanIsSampled(span);
const rootSpan = getRootSpan(span);
const isRootSpan = rootSpan === span;
const header = `[Tracing] Starting ${sampled ? 'sampled' : 'unsampled'} ${isRootSpan ? 'root ' : ''}span`;
const infoParts = [`op: ${op}`, `name: ${description}`, `ID: ${spanId}`];
if (parentSpanId) {
infoParts.push(`parent ID: ${parentSpanId}`);
}
if (!isRootSpan) {
const { op, description } = spanToJSON(rootSpan);
infoParts.push(`root ID: ${rootSpan.spanContext().spanId}`);
if (op) {
infoParts.push(`root op: ${op}`);
}
if (description) {
infoParts.push(`root description: ${description}`);
}
}
debug.log(`${header}
${infoParts.join('\n ')}`);
}
/**
* Print a log message for an ended span.
*/
function logSpanEnd(span) {
if (!DEBUG_BUILD) return;
const { description = '< unknown name >', op = '< unknown op >' } = spanToJSON(span);
const { spanId } = span.spanContext();
const rootSpan = getRootSpan(span);
const isRootSpan = rootSpan === span;
const msg = `[Tracing] Finishing "${op}" ${isRootSpan ? 'root ' : ''}span "${description}" with ID ${spanId}`;
debug.log(msg);
}
export { logSpanEnd, logSpanStart };
//# sourceMappingURL=logSpans.js.map