Home / Class/ LocationAwareSlf4JLogger Class — netty Architecture

LocationAwareSlf4JLogger Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  70f24cb8_4eb8_49b6_3422_ffe5d3e299da["LocationAwareSlf4JLogger"]
  fe7fd5d6_a53e_aa39_01a6_506d2d265abd["LocationAwareSlf4JLogger.java"]
  70f24cb8_4eb8_49b6_3422_ffe5d3e299da -->|defined in| fe7fd5d6_a53e_aa39_01a6_506d2d265abd
  8fa1eaa7_b17e_c841_9e2c_480cf9fc7830["LocationAwareSlf4JLogger()"]
  70f24cb8_4eb8_49b6_3422_ffe5d3e299da -->|method| 8fa1eaa7_b17e_c841_9e2c_480cf9fc7830
  9e47df00_81d8_c776_2f1a_91f87ef2dfa0["log()"]
  70f24cb8_4eb8_49b6_3422_ffe5d3e299da -->|method| 9e47df00_81d8_c776_2f1a_91f87ef2dfa0
  e34e370c_6a03_7e5b_eed9_7ebf0af91519["isTraceEnabled()"]
  70f24cb8_4eb8_49b6_3422_ffe5d3e299da -->|method| e34e370c_6a03_7e5b_eed9_7ebf0af91519
  ac8189c8_0ebe_bfcf_2b07_ae18fee01435["trace()"]
  70f24cb8_4eb8_49b6_3422_ffe5d3e299da -->|method| ac8189c8_0ebe_bfcf_2b07_ae18fee01435
  17f3e9c6_e8ec_311c_b1f6_345bf29e9087["isDebugEnabled()"]
  70f24cb8_4eb8_49b6_3422_ffe5d3e299da -->|method| 17f3e9c6_e8ec_311c_b1f6_345bf29e9087
  624f4911_c654_b031_2f39_004bb91779f0["debug()"]
  70f24cb8_4eb8_49b6_3422_ffe5d3e299da -->|method| 624f4911_c654_b031_2f39_004bb91779f0
  f47a9cfb_7ac6_d47c_c707_59428bcbef51["isInfoEnabled()"]
  70f24cb8_4eb8_49b6_3422_ffe5d3e299da -->|method| f47a9cfb_7ac6_d47c_c707_59428bcbef51
  a70edef5_92a6_1153_2ea1_655764e38fe8["info()"]
  70f24cb8_4eb8_49b6_3422_ffe5d3e299da -->|method| a70edef5_92a6_1153_2ea1_655764e38fe8
  6ce89129_c958_46be_c260_6314ab5ae50c["isWarnEnabled()"]
  70f24cb8_4eb8_49b6_3422_ffe5d3e299da -->|method| 6ce89129_c958_46be_c260_6314ab5ae50c
  744d5fd6_f1e3_4e99_5045_adeba81c9996["warn()"]
  70f24cb8_4eb8_49b6_3422_ffe5d3e299da -->|method| 744d5fd6_f1e3_4e99_5045_adeba81c9996
  260a3f30_9d75_edc7_031f_897d638d5f45["isErrorEnabled()"]
  70f24cb8_4eb8_49b6_3422_ffe5d3e299da -->|method| 260a3f30_9d75_edc7_031f_897d638d5f45
  cab247d6_b940_40bb_5bb2_4188912bcaf9["error()"]
  70f24cb8_4eb8_49b6_3422_ffe5d3e299da -->|method| cab247d6_b940_40bb_5bb2_4188912bcaf9

Relationship Graph

Source Code

common/src/main/java/io/netty/util/internal/logging/LocationAwareSlf4JLogger.java lines 26–252

final class LocationAwareSlf4JLogger extends AbstractInternalLogger {

    // IMPORTANT: All our log methods first check if the log level is enabled before call the wrapped
    // LocationAwareLogger.log(...) method. This is done to reduce GC creation that is caused by varargs.

    static final String FQCN = LocationAwareSlf4JLogger.class.getName();
    private static final long serialVersionUID = -8292030083201538180L;

    private final transient LocationAwareLogger logger;

    LocationAwareSlf4JLogger(LocationAwareLogger logger) {
        super(logger.getName());
        this.logger = logger;
    }

    private void log(final int level, final String message) {
        logger.log(null, FQCN, level, message, null, null);
    }

    private void log(final int level, final String message, Throwable cause) {
        logger.log(null, FQCN, level, message, null, cause);
    }

    private void log(final int level, final org.slf4j.helpers.FormattingTuple tuple) {
        logger.log(null, FQCN, level, tuple.getMessage(), null, tuple.getThrowable());
    }

    @Override
    public boolean isTraceEnabled() {
        return logger.isTraceEnabled();
    }

    @Override
    public void trace(String msg) {
        if (isTraceEnabled()) {
            log(TRACE_INT, msg);
        }
    }

    @Override
    public void trace(String format, Object arg) {
        if (isTraceEnabled()) {
            log(TRACE_INT, org.slf4j.helpers.MessageFormatter.format(format, arg));
        }
    }

    @Override
    public void trace(String format, Object argA, Object argB) {
        if (isTraceEnabled()) {
            log(TRACE_INT, org.slf4j.helpers.MessageFormatter.format(format, argA, argB));
        }
    }

    @Override
    public void trace(String format, Object... argArray) {
        if (isTraceEnabled()) {
            log(TRACE_INT, org.slf4j.helpers.MessageFormatter.arrayFormat(format, argArray));
        }
    }

    @Override
    public void trace(String msg, Throwable t) {
        if (isTraceEnabled()) {
            log(TRACE_INT, msg, t);
        }
    }

    @Override
    public boolean isDebugEnabled() {
        return logger.isDebugEnabled();
    }

    @Override
    public void debug(String msg) {
        if (isDebugEnabled()) {
            log(DEBUG_INT, msg);
        }
    }

    @Override
    public void debug(String format, Object arg) {

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free