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/levelTag.md.
  • 简体中文
  • Function: levelTag()

    function levelTag(lvl: LogLevel, color?: boolean): string;

    Defined in: logs/format.ts:109

    生成紧凑形式的级别标签字符串(例如 [INF]、[WRN]、[ERR]、[OK]、[DBG])。

    Parameters

    ParameterTypeDefault valueDescription
    lvlLogLevelundefined日志级别。
    colorbooleantrue是否应用 ANSI 颜色样式代码。

    Returns

    string

    紧凑级别标签。