MCPcopy Create free account
hub / github.com/github/gh-aw / truncateForLogging

Function truncateForLogging

actions/setup/js/load_agent_output.cjs:19–24  ·  view source on GitHub ↗

* Truncate content for logging if it exceeds the maximum length * @param {string} content - Content to potentially truncate * @returns {string} Truncated content with indicator if truncated

(content)

Source from the content-addressed store, hash-verified

17 * @returns {string} Truncated content with indicator if truncated
18 */
19function truncateForLogging(content) {
20 if (content.length <= MAX_LOG_CONTENT_LENGTH) {
21 return content;
22 }
23 return content.substring(0, MAX_LOG_CONTENT_LENGTH) + `\n... (truncated, total length: ${content.length})`;
24}
25
26/**
27 * Load and parse agent output from the GH_AW_AGENT_OUTPUT file

Callers 1

loadAgentOutputFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected