8.6 Released with 🥽 visionOS support and more!
Check it out

Summary

Functions

addCategories

addCategories(categories: string): void
Adds categories to existing categories the module will trace.
Parameter Default Description
categories
string

The comma-separated list of categories. If not specified all messages from all categories will be traced.

Returns void

addEventListener

addEventListener(listener: TraceEventListener): void
Parameter Default Description
listener

Returns void

addWriter

addWriter(writer: TraceWriter): void
Adds a TraceWriter instance to the trace module.
Parameter Default Description
writer

The TraceWriter instance to add.

Returns void

clearWriters

clearWriters(): void
Clears all the writers from the trace module.
Returns void

disable

disable(): void
Disables the trace module.
Returns void

enable

enable(): void
Enables the trace module.
Returns void

error

error(error: string | Error): void
Passes an error to the registered ErrorHandler
Parameter Default Description
error
string | Error

The error to be handled.

Returns void

getErrorHandler

isCategorySet

isCategorySet(category: string): boolean
Check if category is already set in trace module.
Parameter Default Description
category
string

The category to check.

Returns boolean

isEnabled

isEnabled(): boolean
A function that returns whether the tracer is enabled and there is a point in writing messages. Check this to avoid writing complex string templates. Send error messages even if tracing is disabled.
Returns boolean

notifyEvent

notifyEvent(object: Object, name: string, data?: any): void
Notifies all the attached listeners for an event that has occurred in the sender object.
Parameter Default Description
object
Object

The Object instance that raised the event.

name
string

The name of the raised event.

data
any

An optional parameter that passes the data associated with the event.

Returns void

removeEventListener

removeEventListener(listener: TraceEventListener): void
Parameter Default Description
listener

Returns void

removeWriter

removeWriter(writer: TraceWriter): void
Removes a TraceWriter instance from the trace module.
Parameter Default Description
writer

The TraceWriter instance to remove.

Returns void

setCategories

setCategories(categories: string): void
Sets the categories the module will trace.
Parameter Default Description
categories
string

The comma-separated list of categories. If not specified all messages from all categories will be traced.

Returns void

setErrorHandler

setErrorHandler(handler: TraceErrorHandler): void
Parameter Default Description
handler

Returns void

write

write(message: any, category: string, type?: number): void
Writes a message using the available writers.
Parameter Default Description
message
any

The message to be written.

category
string

The category of the message.

type
number

Optional, the type of the message - info, warning, error.

Returns void
Previous
TouchAction
Next
Utils