TraceUtils.forceEnabled = true
TraceUtils.trace("myTrace") {
// do something
}
object TraceUtils
cookie
: Int
[Get][Set] |
Signature
var cookie: Int |
forceEnabled
: Boolean
[Get][Set] |
Signature
var forceEnabled: Boolean |
beginAsyncSection
(
sectionName
)
|
Begin an async trace section. You will need to call endAsyncSection() to end the current trace section.
val id = TraceUtils.beginAsyncSection("myTrace")
// do something
TraceUtils.endAsyncSection("myTrace", id)
Signature
fun beginAsyncSection(sectionName: String): Int Parameters
sectionName:
String
Returns
Int
|
beginSection
(
sectionName
)
|
Begin a trace section. You will need to call endSection() to end the current trace section. You can nest trace sections.
TraceUtils.beginSection("myTrace")
// do something
TraceUtils.beginSection("myNestedTrace")
// do something else
TraceUtils.endSection() // end myNestedTrace
// do other stuff
TraceUtils.endSection() // end myTrace
Signature
fun beginSection(sectionName: String) Parameters
sectionName:
String
|
endAsyncSection
(
sectionName
, id
)
|
End an async trace section. Make sure you have called a beginAsyncSection() before calling this with the same id.
val id = TraceUtils.beginAsyncSection("myTrace")
// do something
TraceUtils.endAsyncSection("myTrace", id)
Signature
fun endAsyncSection(sectionName: String, id: Int) Parameters
sectionName:
String
id:
Int
|
endSection
()
|
End the current trace section. Make sure you have called a beginSection() before calling this. You are responsible for managing your trace sections.
TraceUtils.beginSection("myTrace")
// do something
TraceUtils.endSection() // end myTrace
Signature
fun endSection() |
trace
(
sectionName
, block
)
|
This method is a convenience method that handles the beginSection() and endSection() for you. It will run the block of code within the trace section.
TraceUtils.trace("myTrace") {
// do something
}
Signature
inline fun trace(sectionName: String, block: () -> Unit) Parameters
sectionName:
String
block:
Function0
|
traceAsync
(
sectionName
, block
)
|
This method is a convenience method that handles the beginAsyncSection() and endAsyncSection() for you. It will run the block of code within the trace section.
TraceUtils.traceAsync("myTrace") {
// do something
}
Signature
inline fun traceAsync(sectionName: String, block: () -> Unit) Parameters
sectionName:
String
block:
Function0
|