Package 

Class DefaultLogger

  • All Implemented Interfaces:
    com.king.logx.logger.ILogger

    
    public class DefaultLogger
    extends Logger
                        

    默认实现的Logger,既美观又实用。

    日志的默认输出格式如下:

    ┌──────────────────────────────
    │ Thread information
    ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
    │ Method stack history
    ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
    │ Log message
    └──────────────────────────────
    • Method Summary

      Modifier and Type Method Description
      Unit log(Integer priority, String tag, String message, Throwable t) Write a log message to its destination.
      • Methods inherited from class com.king.logx.logger.DefaultLogger

        d, d, d, e, e, e, i, i, i, log, log, log, offset, tag, v, v, v, w, w, w, wtf, wtf, wtf
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultLogger

        DefaultLogger(Boolean showThreadInfo, Integer methodCount, Integer methodOffset)
        Parameters:
        showThreadInfo - Whether to show thread info or not.
        methodCount - How many method line to show.
        methodOffset - Hides internal method calls up to offset.
      • DefaultLogger

        DefaultLogger(Boolean showThreadInfo, Integer methodCount)
        Parameters:
        showThreadInfo - Whether to show thread info or not.
        methodCount - How many method line to show.
      • DefaultLogger

        DefaultLogger(Boolean showThreadInfo)
        Parameters:
        showThreadInfo - Whether to show thread info or not.
      • DefaultLogger

        DefaultLogger()
    • Method Detail

      • log

         Unit log(Integer priority, String tag, String message, Throwable t)

        Write a log message to its destination. Called for all level-specific methods by default.

        Parameters:
        priority - Log level.
        tag - Explicit or inferred tag.
        message - Formatted log message.
        t - Accompanying exceptions.