Manage all log messages from SDK modules. You can use this logger to add your own custom
messages and set your own custom log handlers to forward all messages to your own monitoring
system.
By default, all loggers are set to level OFF (Logger.OFF), and
the following log levels are available.
This module is based on js-logger. For more information, see
the js-logger documentation and our examples.
Examples
// Log a message
Logger.info('This is an info log', 445566)
// [Global] 2021-04-05T15:58:44.893Z - This is an info log 445566
// Create a named logger
const myLogger = Logger.get('CustomLogger')
myLogger.setLevel(Logger.WARN)
myLogger.warn('This is a warning log')
// [CustomLogger] 2021-04-05T15:59:53.377Z - This is a warning log
// Profiling
// Start timing something
Logger.time('Timer name')
// ... some time passes ...
// Stop timing something.
Logger.timeEnd('Timer name')
// Timer name: 35282.997802734375 ms