Offirmo’s Universal Debug API

for browsers & node & modules

Intro

Offirmo's Universal Debug API is an awesome library to greatly help the development of medium/big TypeScript/JavaScript apps.

Loggers, with dynamically settable level:

import {
		getLogger,
		overrideHook,
		exposeInternal,
		addDebugCommand,
	} from '@offirmo/universal-debug-api-xxx'

	const logger = getLogger()
	logger.verbose('Starting up...')
	myLogger.warn('Server timeout, will retry...', { timeoutMs: 2000, attemptCount: 3 })

	const SERVER_URL = overrideHook('server-url', 'https://backend.com')

	const state = {
		foo: 42'
	}
	exposeInternal('app.state', state)

	// addDebugCommand is a feature still in progress
			

Logger levels: fatal, emerg, alert, crit, error, warn(ing), notice, info, verbose, log, debug, trace, silly

Advocacy

TODO

Setup

TODO

FAQ

Is that used in production somewhere?

I, the author, am using this lib in production for my pet project TODO link.

Are there any tradeoffs?

Yes, all solutions have tradeoffs. Here are the most notable one:

  • TODO

Contributing

TODO

Credits