README.md in ougai-0.1.1 vs README.md in ougai-0.1.2
- old
+ new
@@ -1,9 +1,10 @@
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)
A JSON logger is compatible with [bunyan](https://github.com/trentm/node-bunyan) for Node.js
## Installation
@@ -34,17 +35,31 @@
require 'ougai'
logger = Ougai::Logger.new(STDOUT)
```
-### log only message
+### log only a message
```ruby
logger.info('Information!')
```
```json
{"name":"main","hostname":"mint","pid":14607,"level":30,"time":"2016-10-16T22:26:48.835+09:00","v":0,"msg":"Information!"}
+```
+
+### log only an exception
+
+```ruby
+begin
+ raise StandardError, 'some error'
+rescue => ex
+ logger.error(ex)
+end
+```
+
+```json
+{"name":"main","hostname":"mint","pid":4422,"level":50,"time":"2016-10-22T13:05:02.989+09:00","v":0,"msg":"some error","err":{"name":"StandardError","message":"some error","stack":"main.rb:24:in `<main>'"}}
```
### log with a message and custom data
```ruby