1.1.2 • Published 4 years ago
mustang-log v1.1.2
How it works:
const { log } = require('mustang-log');
log('something', 'TYPE', showTime);
//TYPES: INFO, DEBUG, WARN, ERROR, VERBOSE(default, specify no type).
// showTime: Show time at which it was logged. (prefixed)
Custom log TYPES!
const { log } = require('mustang-log');
log('this is custom!', {name: 'CUSTOM', bgColor: '#ff0000', textColor: '#ffffff'})
Info:
const { log } = require('mustang-log');
log('This is what info looks like!', 'INFO');
Debug:
const { log } = require('mustang-log');
log('This is what debug looks like!', 'DEBUG');
Warn:
const { log } = require('mustang-log');
log('This is what warn looks like!', 'warn');
Error:
const { log } = require('mustang-log');
log('This is what error looks like!', 'error');
Verbose:
const { log } = require('mustang-log');
log('This is what verbose looks like!');
Logging objects
For the debug tag, we can imagine you want to log objects or similar types. this is possible.
log({
"objecs":"log nicely too!",
logging: (arg) => {
log('something', 'verbose', true)
}
}, 'DEBUG');
Translates to: You can see linebreaks and newlines are handled just fine.