Skip to content

Commit 674033c

Browse files
committed
Merge pull request Unitech#9 from rlidwka/colors
color issues
2 parents 488519f + a2c3f4d commit 674033c

File tree

1 file changed

+8
-17
lines changed

1 file changed

+8
-17
lines changed

lib/Log.js

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,13 @@
44
var fs = require('fs');
55

66
var colors = [
7-
'\x1B[34m',
8-
'\x1B[36m',
9-
'\x1B[32m',
10-
'\x1B[35m',
11-
'\x1B[31m',
12-
'\x1B[30m',
13-
'\x1B[90m',
14-
'\x1B[33m',
15-
'\x1B[34m',
16-
'\x1B[36m',
17-
'\x1B[32m',
18-
'\x1B[35m',
19-
'\x1B[31m',
20-
'\x1B[30m',
21-
'\x1B[90m',
22-
'\x1B[33m'
7+
'\x1B[34m', // blue
8+
'\x1B[36m', // cyan
9+
'\x1B[32m', // green
10+
'\x1B[35m', // magenta
11+
'\x1B[31m', // red
12+
'\x1B[90m', // grey
13+
'\x1B[33m', // yellow
2314
];
2415

2516
var gl_idx = 0;
@@ -41,7 +32,7 @@ Log.stream = function(path, title) {
4132
return false;
4233
}
4334

44-
var odb = db[title] = {color : colors[gl_idx++], l : 0};
35+
var odb = db[title] = {color : colors[gl_idx++ % colors.length], l : 0};
4536

4637
fs.stat(path, function(err, stat) {
4738
var rstream = fs.createReadStream(path, {

0 commit comments

Comments
 (0)