Class LoggerUtil

java.lang.Object
io.agentscope.core.a2a.agent.utils.LoggerUtil

public class LoggerUtil extends Object
A2A agent logger util.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    debug(org.slf4j.Logger logger, String format, Object... args)
    Records DEBUG level log information
    static void
    error(org.slf4j.Logger logger, String format, Object... args)
    Records ERROR level log information
    static void
    info(org.slf4j.Logger logger, String format, Object... args)
    Records INFO level log information
    static void
    logA2aClientEventDetail(org.slf4j.Logger logger, io.a2a.client.ClientEvent event)
    Logs detailed information of A2A client events to the log
    static void
    logAgentEventDetail(org.slf4j.Logger logger, io.agentscope.core.agent.Event event)
    Logs detail information of AgentScope events output from Agent.
    static void
    logTextMsgDetail(org.slf4j.Logger logger, List<io.agentscope.core.message.Msg> msgs)
    Logs detailed information about the text content in a list of messages
    static void
    trace(org.slf4j.Logger logger, String format, Object... args)
    Records TRACE level log information
    static void
    warn(org.slf4j.Logger logger, String format, Object... args)
    Records WARN level log information

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LoggerUtil

      public LoggerUtil()
  • Method Details

    • logAgentEventDetail

      public static void logAgentEventDetail(org.slf4j.Logger logger, io.agentscope.core.agent.Event event)
      Logs detail information of AgentScope events output from Agent.
      Parameters:
      logger - The Logger instance used for logging
      event - The event object to be logged from AgentScope Agent.
    • logA2aClientEventDetail

      public static void logA2aClientEventDetail(org.slf4j.Logger logger, io.a2a.client.ClientEvent event)
      Logs detailed information of A2A client events to the log
      Parameters:
      logger - The Logger instance used for logging
      event - The client event object to be logged
    • logTextMsgDetail

      public static void logTextMsgDetail(org.slf4j.Logger logger, List<io.agentscope.core.message.Msg> msgs)
      Logs detailed information about the text content in a list of messages
      Parameters:
      logger - The Logger instance used for logging
      msgs - The list of message objects containing content to be logged
    • trace

      public static void trace(org.slf4j.Logger logger, String format, Object... args)
      Records TRACE level log information

      This method first checks whether the logger has TRACE level enabled, and if so, records the formatted log information. This avoids unnecessary string formatting operations when the log level is not enabled, improving performance.

      Parameters:
      logger - The logger instance used to perform the actual logging operation
      format - The format string for the log message, following the format specification of SLF4J
      args - The parameter array used to replace placeholders in the format string
    • debug

      public static void debug(org.slf4j.Logger logger, String format, Object... args)
      Records DEBUG level log information

      This method first checks whether the logger has DEBUG level enabled, and if so, records the formatted log information. This avoids unnecessary string formatting operations when the log level is not enabled, improving performance.

      Parameters:
      logger - The logger instance used to perform the actual logging operation
      format - The format string for the log message, following the format specification of SLF4J
      args - The parameter array used to replace placeholders in the format string
    • info

      public static void info(org.slf4j.Logger logger, String format, Object... args)
      Records INFO level log information

      This method first checks whether the logger has INFO level enabled, and if so, records the formatted log information. This avoids unnecessary string formatting operations when the log level is not enabled, improving performance.

      Parameters:
      logger - The logger instance used to perform the actual logging operation
      format - The format string for the log message, following the format specification SLF4J
      args - The parameter array used to replace placeholders in the format string
    • warn

      public static void warn(org.slf4j.Logger logger, String format, Object... args)
      Records WARN level log information

      This method first checks whether the logger has WARN level enabled, and if so, records the formatted log information. This avoids unnecessary string formatting operations when the log level is not enabled, improving performance.

      Parameters:
      logger - The logger instance used to perform the actual logging operation
      format - The format string for the log message, following the format specification SLF4J
      args - The parameter array used to replace placeholders in the format string
    • error

      public static void error(org.slf4j.Logger logger, String format, Object... args)
      Records ERROR level log information

      This method first checks whether the logger has ERROR level enabled, and if so, records the formatted log information. This avoids unnecessary string formatting operations when the log level is not enabled, improving performance.

      Parameters:
      logger - The logger instance used to perform the actual logging operation
      format - The format string for the log message, following the format specification SLF4J
      args - The parameter array used to replace placeholders in the format string