TritonHelper
The TritonHelper class provides utility methods and builder classes for the Triton logging framework.
This class is mostly for internal use and includes functionality for log level management, UUID generation, HTTP request/response serialization, and message formatting.
Transaction Cache Methods
cacheTransactionId
Saves transaction ID to platform cache with user-specific key. Silently handles cache failures.
Parameters:
transactionId
- Transaction ID to cache
getCachedTransactionId
Retrieves transaction ID from platform cache using user-specific key.
Returns:
Cached transaction ID or null if not found
clearCachedTransactionId
Clears transaction ID from platform cache.
Stack Trace Methods
getCurrentStackTrace
Returns the current stack trace as a string, excluding any Triton-related entries.
Returns:
Filtered stack trace with lines joined by newline characters
getOperation
Extracts the operation (Class.Method) from a stack trace string, taking the topmost non-Triton entry.
Parameters:
stackTrace
- The stack trace string to parse
Returns:
String in format "ClassName.MethodName"
Runtime Info Formatting
formatLwcRuntimeInfo
Formats runtime information from LWC into a readable string, including environment, performance, memory, network, and device details.
Parameters:
runtime
- The runtime info object to format
Returns:
Formatted string with all runtime details
Utility Methods
buildLogLevelKey
Creates a key for log level based on category, type, and area parameters.
Parameters:
category
- Log category fieldtype
- Log type fieldarea
- Log functional area field
Returns:
String in the format:
Category:{0};Type:{1};Area:{2}
compareLevel
Compares two log levels to determine if logging should proceed.
Parameters:
value
- The level to compare against (from settings)toCompare
- The level being compared (from log)
Returns:
true
if value is greater than or equal to toComparefalse
if value is lower than toCompare
generateUUID4
Generates a UUID (Universal Unique Identifier) version 4. Used to create transaction IDs.
Returns:
String containing a UUID4 formatted identifier
toJson (HTTP)
Serializes HTTP request and response objects to JSON format for integration logging.
Parameters:
request
- HttpRequest instanceresponse
- HttpResponse instance
Returns:
JSON string containing formatted request and response data
toJson (REST)
Serializes REST request and response objects to JSON format for integration logging.
Parameters:
request
- RestRequest instanceresponse
- RestResponse instance
Returns:
JSON string containing formatted request and response data
formatMessage (Single Parameter)
Formats a message by replacing {0} placeholder with the provided parameter.
Parameters:
template
- Message template containing {0} placeholderparam
- Parameter to replace the placeholder
Returns:
Formatted message string
formatMessage (Multiple Parameters)
Formats a message by replacing {0}, {1}, etc. placeholders with the provided parameters.
Parameters:
template
- Message template containing numbered placeholdersparams
- List of parameters to replace the placeholders
Returns:
Formatted message string
Builder Class
PostProcessingControlsBuilder
Builder class for constructing Pharos post-processing settings. Controls various aspects of log enhancement after creation. You can find a more detailed method reference here.
Methods
Each method controls a specific aspect of post-processing:
auditTrail
- Controls fetching of recent audit traildeployResult
- Controls fetching of recent deploymentsinstalledPackages
- Controls fetching of installed package countarea
- Controls automatic functional area settingpendingJobs
- Controls fetching of pending jobs in flow queuerelatedObjects
- Controls fetching of related object namesstackTrace
- Controls stack trace enhancement (Apex/Integration logs only)userInfo
- Controls fetching of User nametotalActiveSession
- Controls fetching of current logged-in user countsetAll
- Sets all flags to the provided value
Build Method:
Returns a JSON string representation of the post-processing controls.
Example:
IntegrationWrapper
Wrapper class for integration logs used to create the JSON structure that combines HTTP objects.
Properties:
request
- Map<String, Object> containing request detailsresponse
- Map<String, Object> containing response details
This class is primarily used internally by the toJson methods to structure integration log data.
Runtime Information Components
Captures detailed runtime information from Lightning Web Components:
Environment details (user agent, platform, language)
Performance metrics (page load time, DOM events, paint times)
Memory usage statistics
Network information (connection type, speed, RTT)
Device characteristics (form factor, screen dimensions)
Navigation context (pathname, hostname)
Last updated