textlint
Version:
The pluggable linting tool for text and markdown.
37 lines (34 loc) • 1.19 kB
JavaScript
// LICENSE : MIT
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Logger = void 0;
/* eslint-disable no-console */
/**
* Logger Utils class
* Use this instead of `console.log`
* Main purpose for helping linting.
*/
class Logger {
static log(...message) {
console.log(...message);
}
static warn(...message) {
console.warn(...message);
}
static deprecate(message) {
const templateDeprecatedionMessage = `textlint: ${message}
You can control this deprecation message by Node.js command-line flags.
If the NODE_OPTIONS=--throw-deprecation is used, the deprecation warning is thrown as an exception rather than being emitted as an event.
If the NODE_OPTIONS=--no-deprecation is used, the deprecation warning is suppressed.
If the NODE_OPTIONS=--trace-deprecation is used, the deprecation warning is printed to stderr along with the full stack trace.
`;
process.emitWarning(templateDeprecatedionMessage, {
type: "DeprecationWarning"
});
}
static error(...message) {
console.error(...message);
}
}
exports.Logger = Logger;
//# sourceMappingURL=logger.js.map