Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const enableLogging = function(
logger_?: boolean | ((a: string) => void) | null,
persistent?: boolean
) {
assert(
!persistent || logger_ === true || logger_ === false,
"Can't turn on custom loggers persistently."
);
if (logger_ === true) {
logClient.logLevel = LogLevel.VERBOSE;
logger = logClient.log.bind(logClient);
if (persistent) {
SessionStorage.set('logging_enabled', true);
}
} else if (typeof logger_ === 'function') {
logger = logger_;
} else {
logger = null;
SessionStorage.remove('logging_enabled');
}
};