Class LogConfiguration

    • Field Detail

      • logLevel

        public final int logLevel
        The log level, the logs below of which would not be printed.
      • tag

        public final java.lang.String tag
        The tag string.
      • withThread

        public final boolean withThread
        Whether we should log with thread info.
      • withStackTrace

        public final boolean withStackTrace
        Whether we should log with stack trace.
      • stackTraceOrigin

        public final java.lang.String stackTraceOrigin
        The origin of stack trace elements from which we should not log when logging with stack trace, it can be a package name like "com.elvishew.xlog", a class name like "com.yourdomain.logWrapper", or something else between package name and class name, like "com.yourdomain.".

        It is mostly used when you are using a logger wrapper.

        Since:
        1.4.0
      • stackTraceDepth

        public final int stackTraceDepth
        The number of stack trace elements we should log when logging with stack trace, 0 if no limitation.
      • withBorder

        public final boolean withBorder
        Whether we should log with border.
      • jsonFormatter

        public final JsonFormatter jsonFormatter
        The JSON formatter used to format the JSON string when log a JSON string.
      • xmlFormatter

        public final XmlFormatter xmlFormatter
        The XML formatter used to format the XML string when log a XML string.
      • throwableFormatter

        public final ThrowableFormatter throwableFormatter
        The throwable formatter used to format the throwable when log a message with throwable.
      • threadFormatter

        public final ThreadFormatter threadFormatter
        The thread formatter used to format the thread when logging.
      • stackTraceFormatter

        public final StackTraceFormatter stackTraceFormatter
        The stack trace formatter used to format the stack trace when logging.
      • borderFormatter

        public final BorderFormatter borderFormatter
        The border formatter used to format the border when logging.
      • interceptors

        public final java.util.List<Interceptor> interceptors
        The interceptors, used to intercept the log when logging.
        Since:
        1.3.0
    • Method Detail

      • getObjectFormatter

        public <T> ObjectFormatter<? super T> getObjectFormatter​(T object)
        Get ObjectFormatter for specific object.
        Type Parameters:
        T - the type of object
        Parameters:
        object - the object
        Returns:
        the object formatter for the object, or null if not found
        Since:
        1.1.0