Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/umbrellio/threaded_logging
Better formatter for Ruby loggers.
https://github.com/umbrellio/threaded_logging
logger logging ruby ruby-logger threaded-logging
Last synced: about 2 months ago
JSON representation
Better formatter for Ruby loggers.
- Host: GitHub
- URL: https://github.com/umbrellio/threaded_logging
- Owner: umbrellio
- License: mit
- Created: 2016-05-23T19:06:26.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-11-15T17:54:39.000Z (about 5 years ago)
- Last Synced: 2024-10-18T18:58:03.822Z (3 months ago)
- Topics: logger, logging, ruby, ruby-logger, threaded-logging
- Language: Ruby
- Homepage:
- Size: 14.6 KB
- Stars: 8
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# threaded_logging · [![Gem Version](https://badge.fury.io/rb/threaded_logging.svg)](https://badge.fury.io/rb/threaded_logging) [![Build Status](https://travis-ci.org/umbrellio/threaded_logging.svg?branch=master)](https://travis-ci.org/umbrellio/threaded_logging) [![Coverage Status](https://coveralls.io/repos/github/umbrellio/threaded_logging/badge.svg?branch=master)](https://coveralls.io/github/umbrellio/threaded_logging?branch=master)
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
```ruby
gem 'threaded_logging'
``````shell
$ bundle install
# --- or ---
$ gem install 'threaded_logging'
``````ruby
require 'threaded_logging'
```## Usage
Before:
```ruby
> Logger.new(STDOUT).info("Line 1\nLine 2")
I, [2016-05-23T22:33:40.649346 #13604] INFO -- : Line 1
Line 2
```After:
```ruby
> Logger.new(STDOUT).info("Line 1\nLine 2")
I [2016-05-23T22:32:30.483767] #bd134bb0: Line 1
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.