Class SdkLogger

    • Field Detail

      • NOOP_LOGGER

        private static final Logger NOOP_LOGGER
      • loggerEnabled

        private final boolean loggerEnabled
    • Method Detail

      • logRecordBuilder

        public LogRecordBuilder logRecordBuilder()
        Description copied from interface: Logger
        Return a LogRecordBuilder to emit a log record.

        IMPORTANT: this should be used to write appenders to bridge logs from logging frameworks (e.g. SLF4J, Log4j, JUL, Logback, etc). It is NOT a replacement for an application logging framework, and should not be used by application developers.

        Build the log record using the LogRecordBuilder setters, and emit via LogRecordBuilder.emit().

        Specified by:
        logRecordBuilder in interface Logger
      • isEnabled

        public boolean isEnabled()
        Description copied from interface: ExtendedLogger
        Returns true if the logger is enabled.

        This allows callers to avoid unnecessary compute when nothing is consuming the data. Because the response is subject to change over the application, callers should call this before each call to Logger.logRecordBuilder().

        Specified by:
        isEnabled in interface ExtendedLogger