TritonUtils
Overview
The TritonUtils
module provides utility functions for stack trace analysis, transaction management, and runtime information capture in the Triton logging framework.
Stack Trace Analysis
isNotTriton(stackTraceLine)
Description: Checks if a stack trace line is from internal Triton files
Parameters:
stackTraceLine
:{string}
Line from stack trace to check
Returns:
{boolean}
True if the line is NOT from internal Triton filesExample:
isLWCLine(stackTraceLine)
Description: Determines if a stack trace line is from an LWC component
Parameters:
stackTraceLine
:{string}
Line from stack trace to check
Returns:
{boolean}
True if the line is from an LWC componentExample:
isComponentLine(stackTraceLine)
Description: Checks if a stack trace line is from a component (LWC or Aura)
Parameters:
stackTraceLine
:{string}
Line from stack trace to check
Returns:
{boolean}
True if the line is from a componentExample:
isAuraLine(stackTraceLine)
Description: Determines if a stack trace line is from an Aura component
Parameters:
stackTraceLine
:{string}
Line from stack trace to check
Returns:
{boolean}
True if the line is from an Aura componentExample:
isAura([stack])
Description: Determines if a stack trace is from an Aura component
Parameters:
stack
:{string}
Optional stack trace to analyze. If not provided, gets current stack trace
Returns:
{boolean}
True if the stack trace contains Aura component referencesExample:
Transaction Management
generateTransactionId()
Description: Generates a UUID v4 (random UUID)
Returns:
{string}
The generated UUID in format: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxxExample:
Runtime Information
captureRuntimeInfo()
Description: Captures comprehensive runtime information about the current environment
Returns:
{Object}
Object containing:Environment info (userAgent, language, platform)
Viewport dimensions
Theme settings
Performance metrics
Network info
Device info
Example:
Component Identification
extractComponentName(componentLine)
Description: Extracts the component name from a stack trace line
Parameters:
componentLine
:{string}
Stack trace line containing component info
Returns:
{string}
Component name or 'unknown-component' if not foundExample:
generateComponentId()
Description: Extracts the component identifier from the current stack trace
Returns:
{string}
Component identifierExample:
Performance Metrics
The runtime information capture includes detailed performance metrics:
Network Information
The runtime information capture includes network details:
Device Information
The runtime information capture includes device details:
Last updated