Would you like to contribute to the Titanium docs? To get started, sign up for an account on the Appcelerator Wiki and sign our CLA.

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Logger API

The logger class lets you add custom messages to the application log, in addition to the ones generated automatically by Arrow Cloud

Multiexcerpt include
MultiExcerptNamearrow-arrow-cloud
PageWithExcerptDPV:Arrow Products
. For published applications, custom log messages appear in the output of the loglist and logcat commands. When running your application locally (via the appc cloud run command, they are displayed in the local console.

Note

In productions, you may want to minimize output logs to improve application performance and reduce memory consumption.

Usage

First, require the logger class:

...

When running your application locally via the acs run command log messages are displayed in the console.

Specifying Application Log Level

To set the log level, you call logger.setLevel() and pass it one of the following log level strings, in ascending order of log detail:

...

The default log level is "DEBUG", if not specified.

Logging Methods

To log a message, call one of the following methods, passing it the string to output. The logging level must be set to an appropriate level.

...