sample.js
function writeLogs(customMethods) {

	// Error level logging with a message but no error
	console.error('Testing ERROR LEVEL without actual error')
	
	// Error level logging with an error but no message
	// This shows enhanced error parsing in logging 
	console.error(new Error("some error"));

	// Error level logging with both message and error
	// This shows enhanced error parsing in logging 
	console.error('Testing ERROR LEVEL with an error', new Error("some error"));
	
	// Warn level logging
	console.warn('Testing WARN LEVEL');

	// Info level logging
	console.info('Testing INFO LEVEL');

	// Log/Debug level logging
	console.log('Testing LOG LEVEL');	
	
	if(customMethods) {
		// Log/Debug level loggin using "debug" alias (not standard but clearer)
		console.debug('Testing DEBUG (AKA LOG) LEVEL');
		
		// Verbose level logging (new level added to go beyond DEBUG)
		console.verbose('Testing TRACE LEVEL');	
	}
}
function writeLogs(customMethods) {

	// Error level logging with a message but no error
	console.error('Testing ERROR LEVEL without actual error')
	
	// Error level logging with an error but no message
	// This shows enhanced error parsing in logging 
	console.error(new Error("some error"));

	// Error level logging with both message and error
	// This shows enhanced error parsing in logging 
	console.error('Testing ERROR LEVEL with an error', new Error("some error"));
	
	// Warn level logging
	console.warn('Testing WARN LEVEL');

	// Info level logging
	console.info('Testing INFO LEVEL');

	// Log/Debug level logging
	console.log('Testing LOG LEVEL');	
	
	if(customMethods) {
		// Log/Debug level loggin using "debug" alias (not standard but clearer)
		console.debug('Testing DEBUG (AKA LOG) LEVEL');
		
		// Verbose level logging (new level added to go beyond DEBUG)
		console.verbose('Testing TRACE LEVEL');	
	}
}
function writeLogs ( customMethods ) { // Error level logging with a message but no error console . error ( 'Testing ERROR LEVEL without actual error' ) // Error level logging with an error but no message // This shows enhanced error parsing in logging  console . error ( new Error ( "some error" ) ) ; // Error level logging with both message and error // This shows enhanced error parsing in logging  console . error ( 'Testing ERROR LEVEL with an error' , new Error ( "some error" ) ) ; // Warn level logging console . warn ( 'Testing WARN LEVEL' ) ; // Info level logging console . info ( 'Testing INFO LEVEL' ) ; // Log/Debug level logging console . log ( 'Testing LOG LEVEL' ) ; if ( customMethods ) { // Log/Debug level loggin using "debug" alias (not standard but clearer) console . debug ( 'Testing DEBUG (AKA LOG) LEVEL' ) ; // Verbose level logging (new level added to go beyond DEBUG) console . verbose ( 'Testing TRACE LEVEL' ) ; } }
Writes logs for the different levels
@param customMethods if false, only standard node's console methods will be called.
if true, besides standard methods, also the 2 new added methods are called
Writes logs for the different levels