AlexzanderFlores / WOKCommands

132 stars 61 forks source link

Add other logging methods #213

Closed tippfehlr closed 2 years ago

tippfehlr commented 2 years ago

Add logger to constructor options, so instead of using console.log you can pass in a function that handles logging

new WOKcommands(client, {
    ...
    logger: {
      log: (a) => log.info(a),
      warn: (a) => log.warn(a),
      error: (a) => log.error(a)
    }
  });

If nothing is supplied, standard console logging is used, so no breaking change.