mirror of
https://github.com/corda/corda.git
synced 2025-01-18 02:39:51 +00:00
Blobinspector: trace level logging with --verbose (#3313)
This commit is contained in:
parent
5f2c3d175d
commit
6a2e50b730
@ -4,7 +4,8 @@ apply plugin: 'kotlin'
|
||||
dependencies {
|
||||
compile project(':client:jackson')
|
||||
compile 'info.picocli:picocli:3.0.0'
|
||||
compile "org.slf4j:slf4j-nop:$slf4j_version"
|
||||
compile "org.slf4j:jul-to-slf4j:$slf4j_version"
|
||||
compile "org.apache.logging.log4j:log4j-slf4j-impl:$log4j_version"
|
||||
compile "com.jcabi:jcabi-manifests:$jcabi_manifests_version"
|
||||
|
||||
testCompile project(':test-utils')
|
||||
|
@ -4,6 +4,7 @@ import com.fasterxml.jackson.core.JsonFactory
|
||||
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory
|
||||
import com.jcabi.manifests.Manifests
|
||||
import net.corda.client.jackson.JacksonSupport
|
||||
import net.corda.core.internal.isRegularFile
|
||||
import net.corda.core.internal.rootMessage
|
||||
import net.corda.core.serialization.SerializationContext
|
||||
import net.corda.core.serialization.deserialize
|
||||
@ -63,6 +64,8 @@ class Main : Runnable {
|
||||
var verbose: Boolean = false
|
||||
|
||||
override fun run() {
|
||||
System.setProperty("logLevel", if (verbose) "trace" else "off")
|
||||
|
||||
val bytes = source!!.readBytes().run {
|
||||
require(size > amqpMagic.size) { "Insufficient bytes for AMQP blob" }
|
||||
sequence()
|
||||
@ -74,6 +77,8 @@ class Main : Runnable {
|
||||
val envelope = DeserializationInput.getEnvelope(bytes)
|
||||
println(envelope.schema)
|
||||
println()
|
||||
println(envelope.transformsSchema)
|
||||
println()
|
||||
}
|
||||
|
||||
initialiseSerialization()
|
||||
@ -112,7 +117,9 @@ private class SourceConverter : ITypeConverter<URL> {
|
||||
return try {
|
||||
URL(value)
|
||||
} catch (e: MalformedURLException) {
|
||||
Paths.get(value).toUri().toURL()
|
||||
val path = Paths.get(value)
|
||||
require(path.isRegularFile()) { "$path is not a file" }
|
||||
path.toUri().toURL()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
13
tools/blobinspector/src/main/resources/log4j2.xml
Normal file
13
tools/blobinspector/src/main/resources/log4j2.xml
Normal file
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Configuration status="info">
|
||||
<Appenders>
|
||||
<Console name="STDOUT" target="SYSTEM_OUT" ignoreExceptions="false">
|
||||
<PatternLayout pattern="[%C{1}.%M] %m%n"/>
|
||||
</Console>
|
||||
</Appenders>
|
||||
<Loggers>
|
||||
<Root level="${sys:logLevel}">
|
||||
<AppenderRef ref="STDOUT"/>
|
||||
</Root>
|
||||
</Loggers>
|
||||
</Configuration>
|
Loading…
Reference in New Issue
Block a user