console: order functions and remove \n\n
This lists all function aliases directly below the declared function. PR-URL: https://github.com/nodejs/node/pull/17707 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
0eab49523d
commit
5b4d5321ee
@ -131,7 +131,6 @@ function write(ignoreErrors, stream, string, errorhandler, groupIndent) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Console.prototype.log = function log(...args) {
|
Console.prototype.log = function log(...args) {
|
||||||
write(this._ignoreErrors,
|
write(this._ignoreErrors,
|
||||||
this._stdout,
|
this._stdout,
|
||||||
@ -142,13 +141,9 @@ Console.prototype.log = function log(...args) {
|
|||||||
this._stdoutErrorHandler,
|
this._stdoutErrorHandler,
|
||||||
this[kGroupIndent]);
|
this[kGroupIndent]);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
Console.prototype.debug = Console.prototype.log;
|
Console.prototype.debug = Console.prototype.log;
|
||||||
|
|
||||||
|
|
||||||
Console.prototype.info = Console.prototype.log;
|
Console.prototype.info = Console.prototype.log;
|
||||||
|
Console.prototype.dirxml = Console.prototype.log;
|
||||||
|
|
||||||
Console.prototype.warn = function warn(...args) {
|
Console.prototype.warn = function warn(...args) {
|
||||||
write(this._ignoreErrors,
|
write(this._ignoreErrors,
|
||||||
@ -157,11 +152,8 @@ Console.prototype.warn = function warn(...args) {
|
|||||||
this._stderrErrorHandler,
|
this._stderrErrorHandler,
|
||||||
this[kGroupIndent]);
|
this[kGroupIndent]);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
Console.prototype.error = Console.prototype.warn;
|
Console.prototype.error = Console.prototype.warn;
|
||||||
|
|
||||||
|
|
||||||
Console.prototype.dir = function dir(object, options) {
|
Console.prototype.dir = function dir(object, options) {
|
||||||
options = Object.assign({ customInspect: false }, options);
|
options = Object.assign({ customInspect: false }, options);
|
||||||
write(this._ignoreErrors,
|
write(this._ignoreErrors,
|
||||||
@ -171,17 +163,12 @@ Console.prototype.dir = function dir(object, options) {
|
|||||||
this[kGroupIndent]);
|
this[kGroupIndent]);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
Console.prototype.dirxml = Console.prototype.log;
|
|
||||||
|
|
||||||
|
|
||||||
Console.prototype.time = function time(label = 'default') {
|
Console.prototype.time = function time(label = 'default') {
|
||||||
// Coerces everything other than Symbol to a string
|
// Coerces everything other than Symbol to a string
|
||||||
label = `${label}`;
|
label = `${label}`;
|
||||||
this._times.set(label, process.hrtime());
|
this._times.set(label, process.hrtime());
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
Console.prototype.timeEnd = function timeEnd(label = 'default') {
|
Console.prototype.timeEnd = function timeEnd(label = 'default') {
|
||||||
// Coerces everything other than Symbol to a string
|
// Coerces everything other than Symbol to a string
|
||||||
label = `${label}`;
|
label = `${label}`;
|
||||||
@ -196,7 +183,6 @@ Console.prototype.timeEnd = function timeEnd(label = 'default') {
|
|||||||
this._times.delete(label);
|
this._times.delete(label);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
Console.prototype.trace = function trace(...args) {
|
Console.prototype.trace = function trace(...args) {
|
||||||
const err = {
|
const err = {
|
||||||
name: 'Trace',
|
name: 'Trace',
|
||||||
@ -206,7 +192,6 @@ Console.prototype.trace = function trace(...args) {
|
|||||||
this.error(err.stack);
|
this.error(err.stack);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
Console.prototype.assert = function assert(expression, ...args) {
|
Console.prototype.assert = function assert(expression, ...args) {
|
||||||
if (!expression) {
|
if (!expression) {
|
||||||
require('assert').ok(false, util.format.apply(null, args));
|
require('assert').ok(false, util.format.apply(null, args));
|
||||||
@ -256,7 +241,6 @@ Console.prototype.group = function group(...data) {
|
|||||||
}
|
}
|
||||||
this[kGroupIndent] += ' ';
|
this[kGroupIndent] += ' ';
|
||||||
};
|
};
|
||||||
|
|
||||||
Console.prototype.groupCollapsed = Console.prototype.group;
|
Console.prototype.groupCollapsed = Console.prototype.group;
|
||||||
|
|
||||||
Console.prototype.groupEnd = function groupEnd() {
|
Console.prototype.groupEnd = function groupEnd() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user