textlint
Version:
The pluggable linting tool for text and markdown.
34 lines (31 loc) • 1.09 kB
JavaScript
// LICENSE : MIT
;
/* eslint-disable no-console */
/**
* Logger Utils class
* Use this instead of `console.log`
* Main purpose for helping linting.
*/
export 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);
}
}
//# sourceMappingURL=logger.js.map