Trace

Tracing information about your app requires the "trace" module.

import * as trace from "tns-core-modules/trace";

Tracing all categories of events.

trace.setCategories(trace.categories.All);
trace.enable();

Tracing specific categories of events.

trace.setCategories(trace.categories.concat(
    trace.categories.Binding
    , trace.categories.Debug
    , trace.categories.Layout
    , trace.categories.NativeLifecycle
    , trace.categories.Navigation
    , trace.categories.Style
    , trace.categories.ViewHierarchy
    , trace.categories.VisualTreeEvents
    ));
trace.enable();

Write your own trace message.

trace.setCategories(trace.categories.Debug);
trace.enable();
if (trace.isEnabled()) {
    trace.write("My Debug Message", trace.categories.Debug);
}

Stay connected with NativeScript

(expect a newsletter every 4-8 weeks)

NativeScript
NativeScript is licensed under the Apache 2.0 license .
© Progress Software Corporation. All Rights Reserved.