File tree 3 files changed +23
-0
lines changed
3 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,10 @@ is used on each argument. See [util.format()][] for more information.
48
48
49
49
Same as ` console.log ` .
50
50
51
+ ### console.debug(object [ ,object, ...] )
52
+
53
+ Same as ` console.log ` .
54
+
51
55
### console.error([ data] [ , ... ] )
52
56
53
57
Same as ` console.log ` but prints to stderr.
@@ -56,6 +60,10 @@ Same as `console.log` but prints to stderr.
56
60
57
61
Same as ` console.error ` .
58
62
63
+ ### console.exception(object [ , object, ...] )
64
+
65
+ Same as ` console.error ` .
66
+
59
67
### console.dir(obj[ , options] )
60
68
61
69
Uses ` util.inspect ` on ` obj ` and prints resulting string to stdout. This function
Original file line number Diff line number Diff line change @@ -40,6 +40,9 @@ Console.prototype.log = function() {
40
40
Console . prototype . info = Console . prototype . log ;
41
41
42
42
43
+ Console . prototype . debug = Console . prototype . log ;
44
+
45
+
43
46
Console . prototype . warn = function ( ) {
44
47
this . _stderr . write ( util . format . apply ( this , arguments ) + '\n' ) ;
45
48
} ;
@@ -48,6 +51,9 @@ Console.prototype.warn = function() {
48
51
Console . prototype . error = Console . prototype . warn ;
49
52
50
53
54
+ Console . prototype . exception = Console . prototype . warn ;
55
+
56
+
51
57
Console . prototype . dir = function ( object , options ) {
52
58
this . _stdout . write ( util . inspect ( object , util . _extend ( {
53
59
customInspect : false
Original file line number Diff line number Diff line change @@ -36,10 +36,19 @@ assert(!called);
36
36
c . log ( 'test' ) ;
37
37
assert ( called ) ;
38
38
39
+ assert . equal ( Console . prototype . log , Console . prototype . debug ) ;
40
+ assert . equal ( c . log ( 'test' ) , c . debug ( 'test' ) ) ;
41
+
39
42
called = false ;
40
43
c . error ( 'test' ) ;
41
44
assert ( called ) ;
42
45
46
+ assert . equal ( Console . prototype . error , Console . prototype . warn ) ;
47
+ assert . equal ( c . error ( 'test' ) , c . warn ( 'test' ) ) ;
48
+
49
+ assert . equal ( Console . prototype . exception , Console . prototype . warn ) ;
50
+ assert . equal ( c . exception ( 'test' ) , c . warn ( 'test' ) ) ;
51
+
43
52
out . write = function ( d ) {
44
53
assert . equal ( '{ foo: 1 }\n' , d ) ;
45
54
called = true ;
You can’t perform that action at this time.
0 commit comments