mirror of
https://github.com/corda/corda.git
synced 2025-02-12 05:35:50 +00:00
Minor: add a couple of utilities to BriefLogFormatter to help cut down on unit test log spew.
This commit is contained in:
parent
a7e407bd74
commit
49b20df6cd
@ -17,6 +17,7 @@ import java.util.logging.Formatter
|
|||||||
import java.util.logging.Level
|
import java.util.logging.Level
|
||||||
import java.util.logging.LogRecord
|
import java.util.logging.LogRecord
|
||||||
import java.util.logging.Logger
|
import java.util.logging.Logger
|
||||||
|
import kotlin.reflect.KClass
|
||||||
|
|
||||||
// A couple of inlined utility functions: the first is just a syntax convenience, the second lets us use
|
// A couple of inlined utility functions: the first is just a syntax convenience, the second lets us use
|
||||||
// Kotlin's string interpolation efficiently: the message is never calculated/concatenated together unless
|
// Kotlin's string interpolation efficiently: the message is never calculated/concatenated together unless
|
||||||
@ -90,5 +91,8 @@ class BriefLogFormatter : Formatter() {
|
|||||||
loggerRefs.add(logger)
|
loggerRefs.add(logger)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun loggingOn(vararg classes: KClass<*>) = initVerbose(*classes.map { "+" + it.java.`package`.name }.toTypedArray())
|
||||||
|
fun loggingOff(vararg classes: KClass<*>) = initVerbose(*classes.map { "-" + it.java.`package`.name }.toTypedArray())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user