Class AndroidPrinter

  • All Implemented Interfaces:
    Printer

    public class AndroidPrinter
    extends java.lang.Object
    implements Printer
    Log Printer using Log.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void println​(int logLevel, java.lang.String tag, java.lang.String msg)
      Print log in new line.
      • Methods inherited from class java.lang.Object

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

      • AndroidPrinter

        public AndroidPrinter()
        Constructor.

        If single message is too long, it will be separated to several chunks automatically, the max size of each chunk default to be 4000, you can specify the maxChunkSize using AndroidPrinter(int).

      • AndroidPrinter

        public AndroidPrinter​(boolean autoSeparate)
        Constructor.
        Parameters:
        autoSeparate - whether the message should be separated by line separator automatically. Imaging there is a message "line1\nline2\nline3", and each line has chars less than max-chunk-size, then the message would be separated to 3 lines automatically
        Since:
        1.7.1
      • AndroidPrinter

        public AndroidPrinter​(int maxChunkSize)
        Constructor.
        Parameters:
        maxChunkSize - the max size of each chunk. If the message is too long, it will be separated to several chunks automatically
        Since:
        1.4.1
      • AndroidPrinter

        public AndroidPrinter​(boolean autoSeparate,
                              int maxChunkSize)
        Constructor.
        Parameters:
        autoSeparate - whether the message should be separated by line separator automatically. Imaging there is a message "line1\nline2\nline3", and each line has chars less than max-chunk-size, then the message would be separated to 3 lines automatically
        maxChunkSize - the max size of each chunk. If the message is too long, it will be separated to several chunks automatically
        Since:
        1.7.1
    • Method Detail

      • println

        public void println​(int logLevel,
                            java.lang.String tag,
                            java.lang.String msg)
        Description copied from interface: Printer
        Print log in new line.
        Specified by:
        println in interface Printer
        Parameters:
        logLevel - the level of log
        tag - the tag of log
        msg - the msg of log