Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
14
Task/Stack-traces/Groovy/stack-traces-2.groovy
Normal file
14
Task/Stack-traces/Groovy/stack-traces-2.groovy
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
def trace = rawTrace().collect {
|
||||
def props = it.properties
|
||||
def keys = (it.properties.keySet() - (new Object().properties.keySet()))
|
||||
props.findAll{ k, v -> k in keys }
|
||||
}
|
||||
|
||||
def propNames = trace[0].keySet().sort()
|
||||
def propWidths = propNames.collect { name -> [name, trace.collect{ it[name].toString() }].flatten()*.size().max() }
|
||||
|
||||
propNames.eachWithIndex{ name, i -> printf("%-${propWidths[i]}s ", name) }; println ''
|
||||
propWidths.each{ width -> print('-' * width + ' ') }; println ''
|
||||
trace.each {
|
||||
propNames.eachWithIndex{ name, i -> printf("%-${propWidths[i]}s ", it[name].toString()) }; println ''
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue