Home / Class/ CommonsLogger Class — netty Architecture

CommonsLogger Class — netty Architecture

Architecture documentation for the CommonsLogger class in CommonsLogger.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  75d2dbc5_5bdb_74c1_4253_285c29d7b6f0["CommonsLogger"]
  d510d362_35ab_d323_9842_b22ad27b846b["CommonsLogger.java"]
  75d2dbc5_5bdb_74c1_4253_285c29d7b6f0 -->|defined in| d510d362_35ab_d323_9842_b22ad27b846b
  8b666cf4_ca76_5b3a_3ae3_ee15f3d02b32["CommonsLogger()"]
  75d2dbc5_5bdb_74c1_4253_285c29d7b6f0 -->|method| 8b666cf4_ca76_5b3a_3ae3_ee15f3d02b32
  3d9cb4fa_3496_5c9d_ae20_a12f6d07de34["isTraceEnabled()"]
  75d2dbc5_5bdb_74c1_4253_285c29d7b6f0 -->|method| 3d9cb4fa_3496_5c9d_ae20_a12f6d07de34
  5ffec4ae_7a1a_a732_2f41_859969a3f5e4["trace()"]
  75d2dbc5_5bdb_74c1_4253_285c29d7b6f0 -->|method| 5ffec4ae_7a1a_a732_2f41_859969a3f5e4
  9cbd2431_2ffd_7c47_8210_fee56ff80299["isDebugEnabled()"]
  75d2dbc5_5bdb_74c1_4253_285c29d7b6f0 -->|method| 9cbd2431_2ffd_7c47_8210_fee56ff80299
  a5568ce9_2161_88f2_a663_e9b524765676["debug()"]
  75d2dbc5_5bdb_74c1_4253_285c29d7b6f0 -->|method| a5568ce9_2161_88f2_a663_e9b524765676
  db072b13_febb_4c71_d9bf_77a1910e660d["isInfoEnabled()"]
  75d2dbc5_5bdb_74c1_4253_285c29d7b6f0 -->|method| db072b13_febb_4c71_d9bf_77a1910e660d
  9bdfc172_d4b3_4ded_76d3_1dc0c6062ce8["info()"]
  75d2dbc5_5bdb_74c1_4253_285c29d7b6f0 -->|method| 9bdfc172_d4b3_4ded_76d3_1dc0c6062ce8
  1e360dc4_bc60_8bae_af7c_9714ed00554f["isWarnEnabled()"]
  75d2dbc5_5bdb_74c1_4253_285c29d7b6f0 -->|method| 1e360dc4_bc60_8bae_af7c_9714ed00554f
  5c8db3bb_02ba_ac42_c7c0_01818e705742["warn()"]
  75d2dbc5_5bdb_74c1_4253_285c29d7b6f0 -->|method| 5c8db3bb_02ba_ac42_c7c0_01818e705742
  0c6ae54e_da97_1376_b4ee_871d1b742b38["isErrorEnabled()"]
  75d2dbc5_5bdb_74c1_4253_285c29d7b6f0 -->|method| 0c6ae54e_da97_1376_b4ee_871d1b742b38
  9da1f16d_c0dd_aae7_aea6_5888e63d839e["error()"]
  75d2dbc5_5bdb_74c1_4253_285c29d7b6f0 -->|method| 9da1f16d_c0dd_aae7_aea6_5888e63d839e

Relationship Graph

Source Code

common/src/main/java/io/netty/util/internal/logging/CommonsLogger.java lines 52–566

@Deprecated
class CommonsLogger extends AbstractInternalLogger {

    private static final long serialVersionUID = 8647838678388394885L;

    private final transient Log logger;

    CommonsLogger(Log logger, String name) {
        super(name);
        this.logger = ObjectUtil.checkNotNull(logger, "logger");
    }

    /**
     * Delegates to the {@link Log#isTraceEnabled} method of the underlying
     * {@link Log} instance.
     */
    @Override
    public boolean isTraceEnabled() {
        return logger.isTraceEnabled();
    }

    /**
     * Delegates to the {@link Log#trace(Object)} method of the underlying
     * {@link Log} instance.
     *
     * @param msg - the message object to be logged
     */
    @Override
    public void trace(String msg) {
        logger.trace(msg);
    }

    /**
     * Delegates to the {@link Log#trace(Object)} method of the underlying
     * {@link Log} instance.
     *
     * <p>
     * However, this form avoids superfluous object creation when the logger is disabled
     * for level TRACE.
     * </p>
     *
     * @param format
     *          the format string
     * @param arg
     *          the argument
     */
    @Override
    public void trace(String format, Object arg) {
        if (logger.isTraceEnabled()) {
            FormattingTuple ft = MessageFormatter.format(format, arg);
            logger.trace(ft.getMessage(), ft.getThrowable());
        }
    }

    /**
     * Delegates to the {@link Log#trace(Object)} method of the underlying
     * {@link Log} instance.
     *
     * <p>
     * However, this form avoids superfluous object creation when the logger is disabled
     * for level TRACE.
     * </p>
     *
     * @param format
     *          the format string
     * @param argA
     *          the first argument
     * @param argB
     *          the second argument
     */
    @Override
    public void trace(String format, Object argA, Object argB) {
        if (logger.isTraceEnabled()) {
            FormattingTuple ft = MessageFormatter.format(format, argA, argB);
            logger.trace(ft.getMessage(), ft.getThrowable());
        }
    }

    /**
     * Delegates to the {@link Log#trace(Object)} method of the underlying
     * {@link Log} instance.

Frequently Asked Questions

What is the CommonsLogger class?
CommonsLogger is a class in the netty codebase, defined in common/src/main/java/io/netty/util/internal/logging/CommonsLogger.java.
Where is CommonsLogger defined?
CommonsLogger is defined in common/src/main/java/io/netty/util/internal/logging/CommonsLogger.java at line 52.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free