项目作者: umbrellio

项目描述 :
Better formatter for Ruby loggers.
高级语言: Ruby
项目地址: git://github.com/umbrellio/threaded_logging.git
创建时间: 2016-05-23T19:06:26Z
项目社区:https://github.com/umbrellio/threaded_logging

开源协议:MIT License

下载


threaded_logging · Gem Version Build Status Coverage Status

This gem patches default Ruby log formatter so that every line includes a digest of current process PID + current thread id so that you can easily grep the logs of every particular thread. It also adds the metadata part to each line of the message in case it is multiline.

Installation

  1. gem 'threaded_logging'
  1. $ bundle install
  2. # --- or ---
  3. $ gem install 'threaded_logging'
  1. require 'threaded_logging'

Usage

Before:

  1. > Logger.new(STDOUT).info("Line 1\nLine 2")
  2. I, [2016-05-23T22:33:40.649346 #13604] INFO -- : Line 1
  3. Line 2

After:

  1. > Logger.new(STDOUT).info("Line 1\nLine 2")
  2. I [2016-05-23T22:32:30.483767] #bd134bb0: Line 1
  3. I [2016-05-23T22:32:30.483767] #bd134bb0: Line 2

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/umbrellio/table_sync.

License

Released under MIT License.

Authors

Created by Yuri Smirnov.


Supported by Umbrellio