Skip to content

Commit 1aacee0

Browse files
committed
refactor
1 parent de7d4a0 commit 1aacee0

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

lib/log.js

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
* Module dependencies.
99
*/
1010

11-
var frmt = require('util').format
12-
, EventEmitter = require('events').EventEmitter;
11+
var fmt = require('util').format;
12+
var EventEmitter = require('events').EventEmitter;
1313

1414
/**
1515
* Initialize a `Loggeer` with the given log `level` defaulting
1616
* 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
2020
* @api public
2121
*/
2222

@@ -29,16 +29,16 @@ var Log = exports = module.exports = function Log(level, stream){
2929

3030
/**
3131
* System is unusable.
32-
*
32+
*
3333
* @type Number
3434
*/
3535

3636
exports.EMERGENCY = 0;
3737

3838
/**
3939
* Action must be taken immediately.
40-
*
41-
* @type Number
40+
*
41+
* @type Number
4242
*/
4343

4444
exports.ALERT = 1;
@@ -53,56 +53,56 @@ exports.CRITICAL = 2;
5353

5454
/**
5555
* Error condition.
56-
*
56+
*
5757
* @type Number
5858
*/
5959

6060
exports.ERROR = 3;
6161

6262
/**
6363
* Warning condition.
64-
*
64+
*
6565
* @type Number
6666
*/
6767

6868
exports.WARNING = 4;
6969

7070
/**
7171
* Normal but significant condition.
72-
*
72+
*
7373
* @type Number
7474
*/
7575

7676
exports.NOTICE = 5;
7777

7878
/**
7979
* Purely informational message.
80-
*
80+
*
8181
* @type Number
8282
*/
8383

8484
exports.INFO = 6;
8585

8686
/**
8787
* Application debug messages.
88-
*
88+
*
8989
* @type Number
9090
*/
9191

9292
exports.DEBUG = 7;
9393

9494
/**
9595
* prototype.
96-
*/
96+
*/
9797

9898
Log.prototype = {
99-
99+
100100
/**
101101
* Start emitting "line" events.
102102
*
103103
* @api public
104104
*/
105-
105+
106106
read: function(){
107107
var buf = ''
108108
, self = this
@@ -120,7 +120,7 @@ Log.prototype = {
120120
date: new Date(captures[1])
121121
, level: exports[captures[2]]
122122
, levelString: captures[2]
123-
, msg: captures[3]
123+
, msg: captures[3]
124124
};
125125
self.emit('line', obj);
126126
} catch (err) {
@@ -134,7 +134,7 @@ Log.prototype = {
134134
self.emit('end');
135135
});
136136
},
137-
137+
138138
/**
139139
* Log output message.
140140
*
@@ -145,7 +145,7 @@ Log.prototype = {
145145

146146
log: function(levelStr, args) {
147147
if (exports[levelStr] <= this.level) {
148-
var msg = frmt.apply(null, args);
148+
var msg = fmt.apply(null, args);
149149
this.stream.write(
150150
'[' + new Date + ']'
151151
+ ' ' + levelStr
@@ -226,7 +226,7 @@ Log.prototype = {
226226
*
227227
* @param {String} msg
228228
* @api public
229-
*/
229+
*/
230230

231231
info: function(msg){
232232
this.log('INFO', arguments);

0 commit comments

Comments
 (0)