AS AgentScopeAPI 手册 / API Reference

LoggerUtil

public class LoggerUtil
源码Source io/agentscope/core/a2a/agent/utils/LoggerUtil.java:30–171

日志记录器 Util,支持智能体之间的发现、委派与协作。位于 io.agentscope.core.a2a.agent.utils 包。核心成员包括 logAgentEventDetail、logA2aClientEventDetail、logTextMsgDetail、trace、debug、info。

A2A agent logger util.

方法摘要Method Summary

方法Method说明Description
public static void logAgentEventDetail(Logger logger, Event event)
static
执行日志智能体事件详情相关操作。
Logs detail information of AgentScope events output from Agent.
public static void logA2aClientEventDetail(Logger logger, ClientEvent event)
static
执行日志 A 2 a 客户端事件详情相关操作。
Logs detailed information of A2A client events to the log
public static void logTextMsgDetail(Logger logger, List<Msg> msgs)
static
执行日志文本消息详情相关操作。
Logs detailed information about the text content in a list of messages
public static void trace(Logger logger, String format, Object... args)
static
执行追踪相关操作。
Records TRACE level log information
public static void debug(Logger logger, String format, Object... args)
static
执行 `debug` 方法。
Records DEBUG level log information
public static void info(Logger logger, String format, Object... args)
static
执行信息相关操作。
Records INFO level log information
public static void warn(Logger logger, String format, Object... args)
static
执行 `warn` 方法。
Records WARN level log information
public static void error(Logger logger, String format, Object... args)
static
执行错误相关操作。
Records ERROR level log information

方法详情Method Detail

logAgentEventDetail

public static void logAgentEventDetail(Logger logger, Event event)
static

执行日志智能体事件详情相关操作。

Logs detail information of AgentScope events output from Agent.

参数Parameters
名称Name类型Type说明Description
loggerLogger日志记录器(类型 `Logger`)。The Logger instance used for logging
eventEvent事件(类型 `Event`)。The event object to be logged from AgentScope Agent.
源码Source io/agentscope/core/a2a/agent/utils/LoggerUtil.java:38–43

logA2aClientEventDetail

public static void logA2aClientEventDetail(Logger logger, ClientEvent event)
static

执行日志 A 2 a 客户端事件详情相关操作。

Logs detailed information of A2A client events to the log

参数Parameters
名称Name类型Type说明Description
loggerLogger日志记录器(类型 `Logger`)。The Logger instance used for logging
eventClientEvent事件(类型 `ClientEvent`)。The client event object to be logged
源码Source io/agentscope/core/a2a/agent/utils/LoggerUtil.java:51–59

logTextMsgDetail

public static void logTextMsgDetail(Logger logger, List<Msg> msgs)
static

执行日志文本消息详情相关操作。

Logs detailed information about the text content in a list of messages

参数Parameters
名称Name类型Type说明Description
loggerLogger日志记录器(类型 `Logger`)。The Logger instance used for logging
msgsList<Msg>消息列表(类型 `List`)。The list of message objects containing content to be logged
源码Source io/agentscope/core/a2a/agent/utils/LoggerUtil.java:67–80

trace

public static void trace(Logger logger, String format, Object... args)
static

执行追踪相关操作。

Records TRACE level log information This method first checks whether the logger has TRACE level enabled, and if so, records the formatted log information.

参数Parameters
名称Name类型Type说明Description
loggerLogger日志记录器(类型 `Logger`)。The logger instance used to perform the actual logging operation
formatString格式(类型 `String`)。The format string for the log message, following the format specification of SLF4J
args varargsObject...参数(类型 `Object...`)。The parameter array used to replace placeholders in the format string
源码Source io/agentscope/core/a2a/agent/utils/LoggerUtil.java:94–98

debug

public static void debug(Logger logger, String format, Object... args)
static

执行 debug 方法。

Records DEBUG level log information This method first checks whether the logger has DEBUG level enabled, and if so, records the formatted log information.

参数Parameters
名称Name类型Type说明Description
loggerLogger日志记录器(类型 `Logger`)。The logger instance used to perform the actual logging operation
formatString格式(类型 `String`)。The format string for the log message, following the format specification of SLF4J
args varargsObject...参数(类型 `Object...`)。The parameter array used to replace placeholders in the format string
源码Source io/agentscope/core/a2a/agent/utils/LoggerUtil.java:112–116

info

public static void info(Logger logger, String format, Object... args)
static

执行信息相关操作。

Records INFO level log information This method first checks whether the logger has INFO level enabled, and if so, records the formatted log information.

参数Parameters
名称Name类型Type说明Description
loggerLogger日志记录器(类型 `Logger`)。The logger instance used to perform the actual logging operation
formatString格式(类型 `String`)。The format string for the log message, following the format specification SLF4J
args varargsObject...参数(类型 `Object...`)。The parameter array used to replace placeholders in the format string
源码Source io/agentscope/core/a2a/agent/utils/LoggerUtil.java:130–134

warn

public static void warn(Logger logger, String format, Object... args)
static

执行 warn 方法。

Records WARN level log information This method first checks whether the logger has WARN level enabled, and if so, records the formatted log information.

参数Parameters
名称Name类型Type说明Description
loggerLogger日志记录器(类型 `Logger`)。The logger instance used to perform the actual logging operation
formatString格式(类型 `String`)。The format string for the log message, following the format specification SLF4J
args varargsObject...参数(类型 `Object...`)。The parameter array used to replace placeholders in the format string
源码Source io/agentscope/core/a2a/agent/utils/LoggerUtil.java:148–152

error

public static void error(Logger logger, String format, Object... args)
static

执行错误相关操作。

Records ERROR level log information This method first checks whether the logger has ERROR level enabled, and if so, records the formatted log information.

参数Parameters
名称Name类型Type说明Description
loggerLogger日志记录器(类型 `Logger`)。The logger instance used to perform the actual logging operation
formatString格式(类型 `String`)。The format string for the log message, following the format specification SLF4J
args varargsObject...参数(类型 `Object...`)。The parameter array used to replace placeholders in the format string
源码Source io/agentscope/core/a2a/agent/utils/LoggerUtil.java:166–170
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.