Logger
Fancy colorful console debugger with custom scope written in tiny TypeScript, ES module.
Example usage
import {createLogger} from '@alwatr/logger';
const logger = createLogger('demo');
function sayHello(name: string) {
logger.logMethodArgs?.('sayHello', {name});
}
Debug/Develope Mode (DEBUG_MODE)
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.
Browser
window.localStorage?.setItem('debug', '1');
Make sure the log level in set correctly.
CLI
DEBUG=1 node index.js