Fancy colorful console debugger with custom scope written in tiny TypeScript, ES module.
import {createLogger} from '@alwatr/logger';
const logger = createLogger('demo');
function sayHello(name: string) {
logger.logMethodArgs?.('sayHello', {name});
}
Many of the methods in the logger are no-ops when the debug mode is off. This is to prevent unnecessary performance impact in production.
window.localStorage?.setItem('debug', '1');
// Please remember to **reload** the window after changing the debug mode.
Make sure the log level in set correctly.
DEBUG=1 node index.js