8
8
* Module dependencies.
9
9
*/
10
10
11
- var frmt = require ( 'util' ) . format
12
- , EventEmitter = require ( 'events' ) . EventEmitter ;
11
+ var fmt = require ( 'util' ) . format ;
12
+ var EventEmitter = require ( 'events' ) . EventEmitter ;
13
13
14
14
/**
15
15
* Initialize a `Loggeer` with the given log `level` defaulting
16
16
* to __DEBUG__ and `stream` defaulting to _stdout_.
17
- *
18
- * @param {Number } level
19
- * @param {Object } stream
17
+ *
18
+ * @param {Number } level
19
+ * @param {Object } stream
20
20
* @api public
21
21
*/
22
22
@@ -29,16 +29,16 @@ var Log = exports = module.exports = function Log(level, stream){
29
29
30
30
/**
31
31
* System is unusable.
32
- *
32
+ *
33
33
* @type Number
34
34
*/
35
35
36
36
exports . EMERGENCY = 0 ;
37
37
38
38
/**
39
39
* Action must be taken immediately.
40
- *
41
- * @type Number
40
+ *
41
+ * @type Number
42
42
*/
43
43
44
44
exports . ALERT = 1 ;
@@ -53,56 +53,56 @@ exports.CRITICAL = 2;
53
53
54
54
/**
55
55
* Error condition.
56
- *
56
+ *
57
57
* @type Number
58
58
*/
59
59
60
60
exports . ERROR = 3 ;
61
61
62
62
/**
63
63
* Warning condition.
64
- *
64
+ *
65
65
* @type Number
66
66
*/
67
67
68
68
exports . WARNING = 4 ;
69
69
70
70
/**
71
71
* Normal but significant condition.
72
- *
72
+ *
73
73
* @type Number
74
74
*/
75
75
76
76
exports . NOTICE = 5 ;
77
77
78
78
/**
79
79
* Purely informational message.
80
- *
80
+ *
81
81
* @type Number
82
82
*/
83
83
84
84
exports . INFO = 6 ;
85
85
86
86
/**
87
87
* Application debug messages.
88
- *
88
+ *
89
89
* @type Number
90
90
*/
91
91
92
92
exports . DEBUG = 7 ;
93
93
94
94
/**
95
95
* prototype.
96
- */
96
+ */
97
97
98
98
Log . prototype = {
99
-
99
+
100
100
/**
101
101
* Start emitting "line" events.
102
102
*
103
103
* @api public
104
104
*/
105
-
105
+
106
106
read : function ( ) {
107
107
var buf = ''
108
108
, self = this
@@ -120,7 +120,7 @@ Log.prototype = {
120
120
date : new Date ( captures [ 1 ] )
121
121
, level : exports [ captures [ 2 ] ]
122
122
, levelString : captures [ 2 ]
123
- , msg : captures [ 3 ]
123
+ , msg : captures [ 3 ]
124
124
} ;
125
125
self . emit ( 'line' , obj ) ;
126
126
} catch ( err ) {
@@ -134,7 +134,7 @@ Log.prototype = {
134
134
self . emit ( 'end' ) ;
135
135
} ) ;
136
136
} ,
137
-
137
+
138
138
/**
139
139
* Log output message.
140
140
*
@@ -145,7 +145,7 @@ Log.prototype = {
145
145
146
146
log : function ( levelStr , args ) {
147
147
if ( exports [ levelStr ] <= this . level ) {
148
- var msg = frmt . apply ( null , args ) ;
148
+ var msg = fmt . apply ( null , args ) ;
149
149
this . stream . write (
150
150
'[' + new Date + ']'
151
151
+ ' ' + levelStr
@@ -226,7 +226,7 @@ Log.prototype = {
226
226
*
227
227
* @param {String } msg
228
228
* @api public
229
- */
229
+ */
230
230
231
231
info : function ( msg ) {
232
232
this . log ( 'INFO' , arguments ) ;
0 commit comments