Skip to content

Latest commit

 

History

History

trace

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
nav-title title description
Module trace
Module trace
Module trace

Module: "trace"

// To import the "trace" module:
var trace = require("trace");
Object Description
TraceWriter An interface used to define a writer used by trace to print (log).
EventListener An interface used to trace information about specific event.
Namespace Description
categories An enum that defines all predefined categories.
messageType An enum that defines all predefined message types.
Functions
  • enable()
    Enables the trace module.
  • disable()
    Disables the trace module.
  • addWriter( writer TraceWriter )
    Adds a TraceWriter instance to the trace module.
    • writer - TraceWriter
      The TraceWriter instance to add.
  • removeWriter( writer TraceWriter )
    Removes a TraceWriter instance from the trace module.
    • writer - TraceWriter
      The TraceWriter instance to remove.
  • clearWriters()
    Clears all the writers from the trace module.
  • setCategories( categories String )
    Sets the categories the module will trace.
    • categories - String
      The comma-separated list of categories. If not specified all messages from all categories will be traced.
  • write( message Object, category String, type? Number )
    Writes a message using the available writers.
    • message - Object
      The message to be written.
    • category - String
      The category of the message.
    • type - (optional) - Number
      Optional, the type of the message - info, warning, error.
  • notifyEvent( object Object, name String, data? Object )
    Notifies all the attached listeners for an event that has occurred in the sender object.
    • object - Object
      The Object instance that raised the event.
    • name - String
      The name of the raised event.
    • data - (optional) - Object
      An optional parameter that passes the data associated with the event.
  • addEventListener( listener EventListener )
  • removeEventListener( listener EventListener )