indianghost-dumphelper is a lightweight package providing a dump helper that can print an object in json format or structured text. It is hightly recommended to use it in log files when it's not possible to debug objects in localhost.
- JDK 1.8+
<dependency>
<groupId>io.github.indianghost</groupId>
<artifactId>indianghost-dumphelper</artifactId>
<version>1.0.0</version>
</dependency>
implementation group: 'io.github.indianghost', name: 'indianghost-dumphelper', version: '1.0.0'
implementation 'io.github.indianghost:indianghost-dumphelper:1.0.0'
implementation("io.github.indianghost:indianghost-dumphelper:1.0.0")
libraryDependencies += "io.github.indianghost" % "indianghost-dumphelper" % "1.0.0"
<dependency org="io.github.indianghost" name="indianghost-dumphelper" rev="1.0.0"/>
@Grapes(
@Grab(group='io.github.indianghost', module='indianghost-dumphelper', version='1.0.0')
)
[io.github.indianghost/indianghost-dumphelper "1.0.0"]
'io.github.indianghost:indianghost-dumphelper:jar:1.0.0'
First of all you should import the class DumpHelper:
import io.github.indianghost.DumpHelper;
Then you can use the method dumpProperties(obj) as:
log.info(DumpHelper.dumpProperties(entityForDemo));
to get the output:
io.github.indianghost.EntityForDemo@351d0846[
age=30
marks=[9.62, 11.14, 17.0]
name=Lorem ipsum
]
Or, you can use the method dumpAsJson(obj) as:
log.info(DumpHelper.dumpAsJSON(entityForDemo));
to get the output:
{
"name" : "Lorem ipsum",
"age" : 30,
"marks" : [ 9.62, 11.14, 17.0 ]
}
Copyright 2022 Achraf BELLAALI indianghost-dump-helper is a free open-source project. The code is released under The MIT LICENSE you can do whatever you want with it !
If you found it helpful, you can support me to develop new projects By :