How to use the debug/node function in debug

To help you get started, we’ve selected a few debug examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github babel / babel / packages / babel-core / src / transformation / file / logger.js View on Github external
import buildDebug from "debug/node";

let verboseDebug = buildDebug("babel:verbose");
let generalDebug = buildDebug("babel");

let seenDeprecatedMessages = [];

export default class Logger {
  constructor(file, filename) {
    this.filename = filename;
    this.file     = file;
  }

  _buildMessage(msg) {
    let parts = `[BABEL] ${this.filename}`;
    if (msg) parts += `: ${msg}`;
    return parts;
  }

  warn(msg) {
github forivall / tacoscript / packages / comal / src / logger.js View on Github external
import buildDebug from "debug/node";

let verboseDebug = buildDebug("comal:verbose");
let generalDebug = buildDebug("comal");

let seenDeprecatedMessages = [];

export default class Logger {
  constructor(opts = {}) {
    this.config(opts);
  }

  config(opts) {
    this.suppressDeprecationMessages = opts.suppressDeprecationMessages;
    this.filename = opts.filename || "(unknown)";
    this.messagePrefix = opts.messagePrefix || "COMAL";
  }

  setFilename(filename) {
github babel / babel / packages / babel-core / src / transformation / file / logger.js View on Github external
import type File from "./index";
import buildDebug from "debug/node";

const verboseDebug = buildDebug("babel:verbose");
const generalDebug = buildDebug("babel");

const seenDeprecatedMessages = [];

export default class Logger {
  constructor(file: File, filename: string) {
    this.filename = filename;
    this.file = file;
  }

  filename: string;
  file: File;

  _buildMessage(msg: string): string {
    let parts = `[BABEL] ${this.filename}`;
    if (msg) parts += `: ${msg}`;
    return parts;
github babel / babel / packages / babel-core / src / transformation / file / logger.js View on Github external
import type File from "./index";
import buildDebug from "debug/node";

const verboseDebug = buildDebug("babel:verbose");
const generalDebug = buildDebug("babel");

const seenDeprecatedMessages = [];

export default class Logger {
  constructor(file: File, filename: string) {
    this.filename = filename;
    this.file = file;
  }

  filename: string;
  file: File;

  _buildMessage(msg: string): string {
    let parts = `[BABEL] ${this.filename}`;
    if (msg) parts += `: ${msg}`;
github babel / babel / packages / babel-core / src / transformation / file / logger.js View on Github external
import buildDebug from "debug/node";

let verboseDebug = buildDebug("babel:verbose");
let generalDebug = buildDebug("babel");

let seenDeprecatedMessages = [];

export default class Logger {
  constructor(file, filename) {
    this.filename = filename;
    this.file     = file;
  }

  _buildMessage(msg) {
    let parts = `[BABEL] ${this.filename}`;
    if (msg) parts += `: ${msg}`;
    return parts;
  }
github forivall / tacoscript / packages / comal / src / logger.js View on Github external
import buildDebug from "debug/node";

let verboseDebug = buildDebug("comal:verbose");
let generalDebug = buildDebug("comal");

let seenDeprecatedMessages = [];

export default class Logger {
  constructor(opts = {}) {
    this.config(opts);
  }

  config(opts) {
    this.suppressDeprecationMessages = opts.suppressDeprecationMessages;
    this.filename = opts.filename || "(unknown)";
    this.messagePrefix = opts.messagePrefix || "COMAL";
  }

  setFilename(filename) {
    this.filename = filename;