Skip to content

Commit 36bfc70

Browse files
committed
Added listW, listE, listV, listE methods
1 parent 801fb76 commit 36bfc70

File tree

4 files changed

+97
-6
lines changed

4 files changed

+97
-6
lines changed

.idea/codeStyles/codeStyleConfig.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ext {
55
compileSdkVersion = 30
66
versionMajor = 2
77
versionMinor = 0
8-
versionPatch = 1
8+
versionPatch = 2
99
versionName = "${versionMajor}.${versionMinor}.${versionPatch}"
1010
versionCode = versionMajor * 10000 + versionMinor * 100 + versionPatch
1111
gitSha = 'git rev-parse --short HEAD'.execute([], project.rootDir).text.trim()

lib/src/main/java/ua/at/tsvetkov/util/logger/Log.kt

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ import ua.at.tsvetkov.util.logger.utils.Format.addThreadInfo
3737
import ua.at.tsvetkov.util.logger.utils.Format.getFormattedMessage
3838
import ua.at.tsvetkov.util.logger.utils.Format.getFormattedThrowable
3939
import ua.at.tsvetkov.util.logger.utils.Format.getTag
40-
import java.util.*
4140

4241
/**
4342
* Extended logger. Allows you to automatically adequately logged class, method and line call in the log. Makes it easy to write logs. For
@@ -473,6 +472,54 @@ object Log {
473472
logToAll(Level.INFO, getTag(), getFormattedMessage(Format.list(list), title).toString())
474473
}
475474

475+
/**
476+
* Logged String representation of list. Each item in new line.
477+
*
478+
* @param list a List
479+
* @param title a title string
480+
*/
481+
@JvmOverloads
482+
@JvmStatic
483+
fun listD(list: List<*>?, title: String? = "List") {
484+
logToAll(Level.DEBUG, getTag(), getFormattedMessage(Format.list(list), title).toString())
485+
}
486+
487+
/**
488+
* Logged String representation of list. Each item in new line.
489+
*
490+
* @param list a List
491+
* @param title a title string
492+
*/
493+
@JvmOverloads
494+
@JvmStatic
495+
fun listV(list: List<*>?, title: String? = "List") {
496+
logToAll(Level.VERBOSE, getTag(), getFormattedMessage(Format.list(list), title).toString())
497+
}
498+
499+
/**
500+
* Logged String representation of list. Each item in new line.
501+
*
502+
* @param list a List
503+
* @param title a title string
504+
*/
505+
@JvmOverloads
506+
@JvmStatic
507+
fun listW(list: List<*>?, title: String? = "List") {
508+
logToAll(Level.WARNING, getTag(), getFormattedMessage(Format.list(list), title).toString())
509+
}
510+
511+
/**
512+
* Logged String representation of list. Each item in new line.
513+
*
514+
* @param list a List
515+
* @param title a title string
516+
*/
517+
@JvmOverloads
518+
@JvmStatic
519+
fun listE(list: List<*>?, title: String? = "List") {
520+
logToAll(Level.ERROR, getTag(), getFormattedMessage(Format.list(list), title).toString())
521+
}
522+
476523
/**
477524
* Logged String representation of Objects array. Each item in new line.
478525
*

lib/src/main/java/ua/at/tsvetkov/util/logger/LogLong.kt

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,16 @@
2929
*/
3030
package ua.at.tsvetkov.util.logger
3131

32+
import ua.at.tsvetkov.util.logger.Log.logToAll
33+
import ua.at.tsvetkov.util.logger.interceptor.Level
34+
import ua.at.tsvetkov.util.logger.utils.Format
3235
import ua.at.tsvetkov.util.logger.utils.Format.addMessage
3336
import ua.at.tsvetkov.util.logger.utils.Format.addStackTrace
3437
import ua.at.tsvetkov.util.logger.utils.Format.addThreadInfo
3538
import ua.at.tsvetkov.util.logger.utils.Format.getFormattedMessage
3639
import ua.at.tsvetkov.util.logger.utils.Format.getFormattedThrowable
3740
import ua.at.tsvetkov.util.logger.utils.Format.getTag
38-
import ua.at.tsvetkov.util.logger.Log.logToAll
39-
import ua.at.tsvetkov.util.logger.utils.Format
40-
import ua.at.tsvetkov.util.logger.interceptor.Level
4141
import java.lang.ref.SoftReference
42-
import java.util.*
4342

4443
/**
4544
* Shows a long log string in LogCat. The LogCat have the real message size for both binary and non-binary logs is ~4076 bytes.
@@ -381,6 +380,50 @@ object LogLong {
381380
print(getTag(), getFormattedMessage(Format.list(list), title), Level.INFO, false)
382381
}
383382

383+
/**
384+
* Logged String representation of list. Each item in new line.
385+
*
386+
* @param list a List
387+
*/
388+
@JvmOverloads
389+
@JvmStatic
390+
fun listD(list: List<*>?, title: String? = "List") {
391+
print(getTag(), getFormattedMessage(Format.list(list), title), Level.DEBUG, false)
392+
}
393+
394+
/**
395+
* Logged String representation of list. Each item in new line.
396+
*
397+
* @param list a List
398+
*/
399+
@JvmOverloads
400+
@JvmStatic
401+
fun listV(list: List<*>?, title: String? = "List") {
402+
print(getTag(), getFormattedMessage(Format.list(list), title), Level.VERBOSE, false)
403+
}
404+
405+
/**
406+
* Logged String representation of list. Each item in new line.
407+
*
408+
* @param list a List
409+
*/
410+
@JvmOverloads
411+
@JvmStatic
412+
fun listW(list: List<*>?, title: String? = "List") {
413+
print(getTag(), getFormattedMessage(Format.list(list), title), Level.WARNING, false)
414+
}
415+
416+
/**
417+
* Logged String representation of list. Each item in new line.
418+
*
419+
* @param list a List
420+
*/
421+
@JvmOverloads
422+
@JvmStatic
423+
fun listE(list: List<*>?, title: String? = "List") {
424+
print(getTag(), getFormattedMessage(Format.list(list), title), Level.ERROR, false)
425+
}
426+
384427
/**
385428
* Logged String representation of Objects array. Each item in new line.
386429
*

0 commit comments

Comments
 (0)