For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /reference/sdk/logs/functions/formatLogLine.md.
  • 简体中文
  • Function: formatLogLine()

    function formatLogLine(entry: LogEntry, color?: boolean): string;

    Defined in: logs/format.ts:275

    格式化单行日志(供子进程 stdout 输出及持久化日志文件落盘)。 输出格式:<ISO时间> [source] [LEVEL] text。

    Parameters

    ParameterTypeDefault valueDescription
    entryLogEntryundefined日志条目结构。
    colorbooleantrue是否包含 ANSI 彩色样式代码(默认为 true)。

    Returns

    string

    格式化后的单行日志文本。