Logging
Summary
- Logging can be used by Support Teams to debug AdapTable
- There are 5 Types of Log Messages which development teams can configure as required
AdapTable logs 5 types of messages to the console as the application runs.
Caution
These messages will only be visible if you choose to make them so - see below for details.
The 5 types are:
- Error
- Warning
- Success
- Info
- Performance Metrics
Note
AdapTable always logs critical messages which need to be seen - these require no developer action to be visible
Making Messages Visible
To make logging visible you need to add a new local storage key-value pair.
Find Out More
This guide by Chrome provides instructions on how to create local storage key-value pairs
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:*'Setting Message Types
If you want a more granular approach, you can filter by message type or by AdapTable instance (or both) using the following pattern:
Adaptable:<adaptableId>:<message_type><adaptableId>is the id of the AdapTable instance you want to log for (which was set during initialisation)<message_type>is the type of message you want to log, can be one of:error: error messageswarn: warning messagessuccess: success messagesinfo: info messagesperf: performance metrics
Examples:
// log all messages for a specific AdapTable instance
localStorage.debug = 'Adaptable:<adaptableId>:*'// log only error messages for all AdapTable instances
localStorage.debug = 'Adaptable:*:error'// log only warn messages for a specific AdapTable instance
localStorage.debug = 'Adaptable:<adaptableId>:warn'Caution
Message types are not additive; to see multiple message types, specify them all and separate by using a comma
// log error and warn messages for a specific AdapTable instance
localStorage.debug = 'Adaptable:<adaptableId>:error,Adaptable:<adaptableId>:warn'// log error and perf messages for all AdapTable instances
localStorage.debug = 'Adaptable:*:error,Adaptable:*:perf'Layout Logging
AdapTable offers additional logging assistance for Layouts as they are so intrinsic to how the tool works.
This can by enabled by setting:
localStorage.debug = 'LayoutManager:*'This will log all changes related to a Layout: e.g. column visibility, sorting, row grouping, column resizing, pivoting, aggregations, pinning, switching the layout etc.
Peformance Logging
Logging can be used to log performance metrics for certain operations.
Find Out More
See the Guide to Profiling for detailed information