diff --git a/CHANGES.md b/CHANGES.md index 7de9ba7..b96c568 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,7 +8,9 @@ Known issues: ## bunyan 1.0.1 (not yet released) -(nothing yet) +- [issue #160] Stop using ANSI 'grey' in `bunyan` CLI output, because of the + problems that causes with Solarized Dark themes (see + ). ## bunyan 1.0.0 diff --git a/README.md b/README.md index 9959ae7..5ebed44 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ facilities in node 0.12 to which bunyan can switch. - [`bunyan` CLI](#cli-usage) for pretty-printing and filtering of Bunyan logs - simple include of log call source location (file, line, function) with [`src: true`](#src) -- light-weight specialization of Logger instances with [`log.child`](#logchild) +- lightweight specialization of Logger instances with [`log.child`](#logchild) - custom rendering of logged objects with ["serializers"](#serializers) - [Runtime log snooping via DTrace support](#dtrace-support) diff --git a/bin/bunyan b/bin/bunyan index 73dc2d6..8b27a30 100755 --- a/bin/bunyan +++ b/bin/bunyan @@ -590,8 +590,10 @@ function isInteger(s) { // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics // Suggested colors (some are unreadable in common cases): -// - Good: cyan, yellow (limited use), grey, bold, green, magenta, red -// - Bad: blue (not visible on cmd.exe) +// - Good: cyan, yellow (limited use), bold, green, magenta, red +// - Bad: blue (not visible on cmd.exe), grey (same color as background on +// Solarized Dark theme from , see +// issue #160) var colors = { 'bold' : [1, 22], 'italic' : [3, 23], @@ -746,8 +748,8 @@ function emitRecord(rec, line, opts, stylize) { var level = (upperPaddedNameFromLevel[rec.level] || 'LVL' + rec.level); if (opts.color) { var colorFromLevel = { - 10: 'grey', // TRACE - 20: 'grey', // DEBUG + 10: 'white', // TRACE + 20: 'yellow', // DEBUG 30: 'cyan', // INFO 40: 'magenta', // WARN 50: 'red', // ERROR @@ -958,9 +960,9 @@ function emitRecord(rec, line, opts, stylize) { } extras = stylize( - (extras.length ? ' (' + extras.join(', ') + ')' : ''), 'grey'); + (extras.length ? ' (' + extras.join(', ') + ')' : ''), 'XXX'); details = stylize( - (details.length ? details.join('\n --\n') + '\n' : ''), 'grey'); + (details.length ? details.join('\n --\n') + '\n' : ''), 'XXX'); if (!short) emit(format('%s %s: %s on %s%s:%s%s\n%s', time, diff --git a/tools/colors.log b/tools/colors.log new file mode 100644 index 0000000..52e35bc --- /dev/null +++ b/tools/colors.log @@ -0,0 +1,8 @@ +# A log file to use to show bunyan colors +{"name":"colors","hostname":"grape.local","pid":52694,"level":10,"msg":"this is the msg","time":"2014-08-10T07:02:40.552Z","src":{"file":"/Users/trentm/tm/node-bunyan/examples/src.js","line":8},"v":0} +{"name":"colors","hostname":"grape.local","pid":52694,"level":20,"msg":"this is the msg","time":"2014-08-10T07:02:40.550Z","v":0} +{"name":"colors","hostname":"grape.local","pid":52694,"level":30,"msg":"this is the msg","time":"2014-08-10T07:02:40.551Z","v":0} +{"name":"colors","hostname":"grape.local","pid":52694,"level":40,"msg":"this is the msg","time":"2014-08-10T07:02:40.551Z","v":0} +{"name":"colors","hostname":"grape.local","pid":52694,"level":50,"msg":"this is the msg","time":"2014-08-10T07:02:40.551Z","v":0} +{"name":"colors","hostname":"grape.local","pid":52694,"agent":"a6359483-80b7-4a71-bb12-84cab83816b3","level":30,"req_id":"baf281a7-e4f3-4e6c-80d3-8154b5b220d0","req":{"method":"HEAD","url":"/agentprobes","headers":{"accept":"application/json","content-type":"application/json","host":"localhost","connection":"close"},"httpVersion":"1.1","trailers":{},"version":"*"},"res":{"statusCode":200,"headers":{"content-md5":"11FxOYiYfpMxmANj4kGJzg==","access-control-allow-origin":"*","access-control-allow-headers":"Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version","access-control-allow-methods":"HEAD","access-control-expose-headers":"X-Api-Version, X-Request-Id, X-Response-Time","connection":"close","date":"Fri, 14 Dec 2012 01:11:04 GMT","server":"Amon Relay/1.0.0","x-request-id":"baf281a7-e4f3-4e6c-80d3-8154b5b220d0","x-response-time":0},"trailer":false},"route":{"name":"HeadAgentProbes","version":false},"latency":0,"secure":false,"_audit":true,"msg":"HeadAgentProbes handled: 200","time":"2012-12-14T01:11:04.218Z","v":0} +{"name":"colors","hostname":"grape.local","pid":52694,"level":60,"msg":"this is the msg","time":"2014-08-10T07:02:40.551Z","v":0}