log.js 386 B

1234567891011121314
  1. function debug(logLevel, ...messages) {
  2. if (logLevel === 'debug')
  3. console.log(...messages);
  4. }
  5. function warn(logLevel, warning) {
  6. if (logLevel === 'debug' || logLevel === 'warn') {
  7. if (typeof process !== 'undefined' && process.emitWarning)
  8. process.emitWarning(warning);
  9. else
  10. console.warn(warning);
  11. }
  12. }
  13. export { debug, warn };