diff --git a/src/util/log/log.js b/src/util/log/log.js index 7345627..1de2b49 100644 --- a/src/util/log/log.js +++ b/src/util/log/log.js @@ -13,7 +13,7 @@ let defaultOptions = { suffix: " >> " }; -const tlog = (client) => (message = "Test Log", options = {}, prenl = false, postnl = false) => { +const tlog = (client) => (message = "Test Log", options = {}, prenl = false, postnl = false, ...multcons) => { let opt = {}; if (typeof options !== 'object') {options = {};} opt.color = options.color || defaultOptions.color; @@ -26,7 +26,7 @@ const tlog = (client) => (message = "Test Log", options = {}, prenl = false, pos client.config.logLevel = getLevel(client.config.logLevel); if (client.config.logLevel < opt.level) {return;} } - console.log(`${prenl ? '\n' : ''}${(opt.sourceColor.startsWith('#') ? chalk.hex(opt.sourceColor) : chalk[opt.sourceColor])(`[${opt.source.toUpperCase()}]`)}${opt.suffix}${options.nc || options.noColor ? message : (opt.color.startsWith('#') ? chalk.hex(opt.color) : chalk[opt.color])(message)}${postnl ? '\n' : ''}`); + console.log(`${prenl ? '\n' : ''}${(opt.sourceColor.startsWith('#') ? chalk.hex(opt.sourceColor) : chalk[opt.sourceColor])(`[${opt.source.toUpperCase()}]`)}${opt.suffix}${options.nc || options.noColor ? message : (opt.color.startsWith('#') ? chalk.hex(opt.color) : chalk[opt.color])(message)}${postnl ? '\n' : ''}`, ...multcons); }; module.exports = (client) => { diff --git a/src/util/log/types.js b/src/util/log/types.js index ddb7525..d65d9c6 100644 --- a/src/util/log/types.js +++ b/src/util/log/types.js @@ -1,20 +1,20 @@ module.exports = (log) => { return { - error: (message, options, newLine, spacer) => log(message, { + error: (message, options, prenl, postnl, ...multcons) => log(message, { color: 'redBright', source: 'err!', sourceColor: 'red', level: 0 - }, newLine, spacer), - warn: (message, options, newLine, spacer) => log(message, { + }, prenl, postnl, ...multcons), + warn: (message, options, prenl, postnl, ...multcons) => log(message, { color: 'yellowBright', source: 'warn', sourceColor: 'yellow', level: 1 - }, newLine, spacer), - success: (message, options, newLine, spacer) => log(message, { + }, prenl, postnl, ...multcons), + success: (message, options, prenl, postnl, ...multcons) => log(message, { color: 'greenBright', source: 'proc' || options && options.source, sourceColor: 'green', level: options && typeof options.level !== 'undefined' ? options.level : 0 - }, newLine, spacer) + }, prenl, postnl, ...multcons) }}; \ No newline at end of file