README.md in ougai-0.3.0 vs README.md in ougai-0.7.0

- old
+ new

@@ -1,12 +1,14 @@ Ougai ===== -[![Build Status](https://travis-ci.org/tilfin/ougai.svg?branch=master)](https://travis-ci.org/tilfin/ougai) [![Gem Version](https://badge.fury.io/rb/ougai.svg)](https://badge.fury.io/rb/ougai) +[![Build Status](https://travis-ci.org/tilfin/ougai.svg?branch=master)](https://travis-ci.org/tilfin/ougai) -A JSON logger is compatible with [bunyan](https://github.com/trentm/node-bunyan) for Node.js +A JSON logger is capable of handling a message, data or an exception easily. +It is compatible with [bunyan](https://github.com/trentm/node-bunyan) for Node.js. +It can also output human readable format for the console. ## Installation Add this line to your application's Gemfile: @@ -141,11 +143,11 @@ ```json {"name":"main","hostname":"mint","pid":14607,"level":50,"time":"2016-10-16T22:26:48.836+09:00","v":0,"msg":"Caught error","err":{"name":"ZeroDivisionError","message":"divided by 0","stack":"main.rb:18:in `/'\n ...'"},"reason":"zero spec"} ``` -## View log by node-bunyan +### View log by node-bunyan Install [bunyan](https://github.com/trentm/node-bunyan) via NPM ``` $ npm install -g bunyan @@ -167,9 +169,30 @@ [2016-10-16T22:26:48.836+09:00] ERROR: main/14607 on mint: Caught error (reason="z main.rb:18:in `/' main.rb:18:in `<main>' ``` +## Use human Readable formatter for console + +Add awesome_print to Gemfile and `bundle` + +```ruby +gem 'awesome_print' +``` + +Set *Ougai::Formatters::Readable* instance to `formatter` accessor + +```ruby +require 'rubygems' +require 'ougai' + +logger = Ougai::Logger.new(STDOUT) +logger.formatter = Ougai::Formatters::Readable.new +``` + +### Screen result example + +![Screen Shot](https://github.com/tilfin/ougai/blob/images/ougai_readable_format.png?raw=true)) ## License [MIT](LICENSE.txt)