debugginglog.js 653 B

123456789101112131415161718192021
  1. // eslint-disable-next-line eslint-comments/disable-enable-pair
  2. /* eslint-disable no-console */
  3. export class DebuggingLog {
  4. dp;
  5. $color = '#3489fd';
  6. constructor(dp) {
  7. this.dp = dp;
  8. }
  9. log = (message, color = this.$color, ...args) => {
  10. if (!this.dp?.$options?.debug)
  11. return;
  12. console.log(`%c${this.dp.id} -> ${message}`, `color: ${color}`, ...args);
  13. };
  14. success = (message, ...args) => {
  15. this.log(`🎉 ${message}`, '#19be6b', ...args);
  16. };
  17. error = (message, ...args) => {
  18. this.log(`🎉 ${message}`, '#fa3534', ...args);
  19. };
  20. }
  21. //# sourceMappingURL=debugginglog.js.map