Home / Function/ fillCallerData() — netty Function Reference

fillCallerData() — netty Function Reference

Architecture documentation for the fillCallerData() function in JdkLogger.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  27b841df_1965_f5bb_684f_f0fcb0210041["fillCallerData()"]
  0ad57b42_5632_326d_8e02_ae2631e3c788["JdkLogger"]
  27b841df_1965_f5bb_684f_f0fcb0210041 -->|defined in| 0ad57b42_5632_326d_8e02_ae2631e3c788
  bee40d1c_26f8_6ea0_6b00_d388f87e356d["log()"]
  bee40d1c_26f8_6ea0_6b00_d388f87e356d -->|calls| 27b841df_1965_f5bb_684f_f0fcb0210041
  style 27b841df_1965_f5bb_684f_f0fcb0210041 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

common/src/main/java/io/netty/util/internal/logging/JdkLogger.java lines 618–646

    private static void fillCallerData(String callerFQCN, LogRecord record) {
        StackTraceElement[] steArray = new Throwable().getStackTrace();

        int selfIndex = -1;
        for (int i = 0; i < steArray.length; i++) {
            final String className = steArray[i].getClassName();
            if (className.equals(callerFQCN) || className.equals(SUPER)) {
                selfIndex = i;
                break;
            }
        }

        int found = -1;
        for (int i = selfIndex + 1; i < steArray.length; i++) {
            final String className = steArray[i].getClassName();
            if (!(className.equals(callerFQCN) || className.equals(SUPER))) {
                found = i;
                break;
            }
        }

        if (found != -1) {
            StackTraceElement ste = steArray[found];
            // setting the class name has the side effect of setting
            // the needToInferCaller variable to false.
            record.setSourceClassName(ste.getClassName());
            record.setSourceMethodName(ste.getMethodName());
        }
    }

Domain

Subdomains

Called By

Frequently Asked Questions

What does fillCallerData() do?
fillCallerData() is a function in the netty codebase, defined in common/src/main/java/io/netty/util/internal/logging/JdkLogger.java.
Where is fillCallerData() defined?
fillCallerData() is defined in common/src/main/java/io/netty/util/internal/logging/JdkLogger.java at line 618.
What calls fillCallerData()?
fillCallerData() is called by 1 function(s): log.

Analyze Your Own Codebase

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

Try Supermodel Free