Logging

Summary

  • Logging can be used by our Support Team to help you with issues in your AdapTable configuration.
  • There are multiple types of Log Messages which development teams can inspect as required.

Logging messages will only be visible if you choose to make them so.

Note

  • AdapTable always logs critical messages which need to be seen
  • These require no developer action to be visible

Enabling Logging

Note

To enable logging, you need to give the localStorage.debug key a string value.

To log all messages you need to do:

// hint: this may be a bit too noisy!
localStorage.debug = '*'

or alternatively, to log all message types for all AdapTable instances:

localStorage.debug = 'Adaptable:*'

Caution

Both Adaptable and InfiniteTable share the same logging package, so enabling all logging for the wildcard channel (*) will also log InfiniteTable messages.

Understanding Logging Channels

The package both Adaptable and InfiniteTable use for logging is inspired by the debug package. This uses channels as a way to differentiate between various types of messages.

You can choose to listen to all channels, by setting localStorage.debug to *, or you can listen to specific channels by setting localStorage.debug to the channel name - wildcards are also supported.

Debug ValueDescription
*All messages, both coming from Infinite and Adaptable
Adaptable:*All messages coming from Adaptable
Adaptable:Logs:*All Log messages of interest to users - for all Adaptable instances
Adaptable:LogsSame as the above
Adaptable:Logs:WarnAll Log messages of type Warn
Adaptable:Logs:ErrorAll Log messages of type Error
Adaptable:Logs:SuccessAll Log messages of type Success
Adaptable:Logs:InfoAll Log messages of type Info
Adaptable:Logs:*:id=<adaptableID>All Log messages for the respective Adaptable instance
Adaptable:Logs:Error:*:id=<adaptableID>All Log Error messages for the respective Adaptable instance
InfiniteTable:*All messages coming from InfiniteTable

Using a wildcard means you will listen to messages in channels that match the wildcard position and have the respective prefix or suffix that wrap the wildcard.

Another supported syntax for listening to multiple channels is to separate them with a comma:

localStorage.debug = 'Adaptable:Logs:Error,Adaptable:Logs:Warn'

This an also be combined with wildcards.

You will generally be interested in logs that are in the Adaptable:Logs channel.

Note

Our recommendation is to set the localStorage.debug to Adaptable:Logs.

localStorage.debug = 'Adaptable:Logs';

All the messages in other channels will probably be too noisy for you.

Those will be useful if you hit some issues with Adaptable - at that point, our support team can request that you enable more verbose logging and share the logging output with us.

If you want to target a specific Adaptable instance, you can listen to the following channel:

localStorage.debug = 'Adaptable:Logs:*:id=<adaptableId>';