Package 

Class Log


  • 
    public final class Log
    
                        

    Main entry for this library. "Without loss of generality"

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private String tag
    • Method Summary

      Modifier and Type Method Description
      final Unit r(Integer logLevel) Disposes this log object and returns underlying stringBuilder to the pool.
      final Log t(Throwable throwable) Shortcut for throwable
      final Log event(Object object, String event) Special case log:<br></br> simpleclassname@hash event<br></br> For example: MainActivity@4fad3412 onCreate<br></br> Convenient way to log lifecycle of object(activity,fragment, etc)
      final Log nl() Appends newLine sequence to current statement.<br></br> newLine sequence can be configured at startup by setting system property wlog.
      final Log a(Boolean value) Appends boolean value to current log statement
      final Log a(Character value) Appends char value to current log statement
      final Log a(Long value) Appends long value to current log statement
      final Log a(Float value) Appends float value to current log statement
      final Log a(Double value) Appends double value to current log statement
      final Log a(CharArray value) Appends char[] value to current log statement
      final Log a(Integer value, Integer radix)
      final Log a(Object object) Appends Object#toString to current log statement
      final <T extends Any> Log a(Iterable<T> iterable, SequenceFormat format)
      final <T extends Any, V extends Any> Log a(Map<T, V> map)
      final Log a(String string)
      final <T extends Any> Log a(KProperty0<T> property, String divider)
      final <T extends Any> Log a(Array<T> array, SequenceFormat format) Appends array of objects with specified SequenceFormatter
      final Log c(Object object) Adds simplified class name to log statement, not Object itself!
      final String getTag()
      final Unit setTag(String tag)
      • Methods inherited from class me.shikhov.wlog.Log

        equals, hashCode, toString
      • Methods inherited from class java.lang.Object

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

      • r

         final Unit r(Integer logLevel)

        Disposes this log object and returns underlying stringBuilder to the pool.

      • t

         final Log t(Throwable throwable)

        Shortcut for throwable

        Parameters:
        throwable - throwable to log
      • event

         final Log event(Object object, String event)

        Special case log:<br></br> simpleclassname@hash event<br></br> For example: MainActivity@4fad3412 onCreate<br></br> Convenient way to log lifecycle of object(activity,fragment, etc)

        Parameters:
        object - object to log
        event - event raised by object
      • nl

         final Log nl()

        Appends newLine sequence to current statement.<br></br> newLine sequence can be configured at startup by setting system property wlog.newLine, default value is \n

      • a

         final Log a(Boolean value)

        Appends boolean value to current log statement

        Parameters:
        value - boolean value to log
      • a

         final Log a(Character value)

        Appends char value to current log statement

        Parameters:
        value - char value to log
      • a

         final Log a(Long value)

        Appends long value to current log statement

        Parameters:
        value - long value to log
      • a

         final Log a(Float value)

        Appends float value to current log statement

        Parameters:
        value - float value to log
      • a

         final Log a(Double value)

        Appends double value to current log statement

        Parameters:
        value - double value to log
      • a

         final Log a(CharArray value)

        Appends char[] value to current log statement

        Parameters:
        value - char[] value to log, can be null
      • a

         final Log a(Object object)

        Appends Object#toString to current log statement

        Parameters:
        object - object to log, can be null
      • c

         final Log c(Object object)

        Adds simplified class name to log statement, not Object itself!<br></br> NOTE: anonymous classes should override toString() method which should return recognizable string

        Parameters:
        object - object which class name will be logged