GitHub release (opens new window) GitHub issues (opens new window) GitHub last commit (opens new window) Analytics (opens new window)

# Log

Dynamic console logging - log using the optimal console method. Provides method overwriting, beforeLog and afterLog hooks.

# Usage

// String
log('string');

// number
log(1);

// array
log(['test', '1', { object: 'prop' }, ['array']]);

// function
log(() => {
	const a = 1;
	const b = 2;

	return a + b;
});

// object
log({
	prop1: 'value1',
	prop2: {
		nestedProp1: 'nestedValue1',
		nestedProp2: 'nestedValue2',
		nestedProp3: 'nestedValue3',
		nestedProp4: 'nestedValue4'
	},
	prop3: 'value3',
	prop4: 'value4'
});

// null
log(null);

// undefined
log(undefined);
log(void 0);

// boolean
log(true);

// RegExp
log(/^[a-z]{3,}$/);

// Date
log(new Date());
log(new Date().getTime());

// Symbol
log(Symbol('foo'));

// Constructor
log(function () {});
log(class A {});
log(Array);
log(Function);
log(new Function());

# Support this project

Tweet (opens new window) Donate (opens new window) Become a Patron (opens new window) Buy Me A Coffee (opens new window)

# LICENSE

MIT