tidy_logger 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 16454c5ba23f0c8f1092e362781dbb6d7b291d5e
4
- data.tar.gz: f0a20d306e31b0e22154b953d4caabaaf7922d80
3
+ metadata.gz: 399ecb4e4d159ae849ab5611ef91e746b85c83c0
4
+ data.tar.gz: 14e72421915437b24f4da99f3a849a53dcff6ff5
5
5
  SHA512:
6
- metadata.gz: 1062ea6dc380d9fbe8f69400ef2ccb6d531f15346d73b96af9bedf03ecf40d2aeed74c7fdfa6f4405b454477510e33cda791610773a4c6be95d9b63ec730b412
7
- data.tar.gz: 7cf680f589e5e8a6c903d91a1d2c7573332174ba2aac9b4246aadab4ef810160fe127a46363f9386374da610dcea4ac6def5f1ffa9c3d0771e1f6a07d3c2039d
6
+ metadata.gz: e59419c2d465714f6bc773c483033caec66f26918b94633aedf65226e2355008961748af8ef18916d3c6c0abfb4cdfdd062f4398e50613ecb71bcac9ea8010c3
7
+ data.tar.gz: 9f617a380f676eba25c979690e5440d900b4b279ef92b739e6943f6a6e8143dff5a7c943312e7886b1efa18362a126124986e50650377d9e289875b789f065fe
data/README.md CHANGED
@@ -1,29 +1,69 @@
1
1
  # TidyLogger
2
2
 
3
- TODO: Write a gem description
3
+ [![Build Status](https://travis-ci.org/kenn/tidy_logger.png)](https://travis-ci.org/kenn/tidy_logger)
4
+
5
+ Better API for Ruby’s stdlib Logger
4
6
 
5
7
  ## Installation
6
8
 
7
9
  Add this line to your application's Gemfile:
8
10
 
9
- gem 'tidy_logger'
11
+ ```ruby
12
+ gem 'tidy_logger'
13
+ ```
14
+
15
+ ## Usage
10
16
 
11
- And then execute:
17
+ Ruby's stdlib `Logger` is great. It gives you so many features that you don't want to reinvent.
12
18
 
13
- $ bundle
19
+ ```ruby
20
+ require 'logger'
14
21
 
15
- Or install it yourself as:
22
+ logger = Logger.new(STDOUT)
23
+ logger.info 'hello world!' # => "I, [2013-03-21T19:46:31.703381 #27585] INFO -- : hello world!\n"
24
+ ```
16
25
 
17
- $ gem install tidy_logger
26
+ But, don't you think the default format is ugly? I do!
18
27
 
19
- ## Usage
28
+ Here comes TidyLogger. It is a subclass of and 100% compatible with the stdlib Logger. You can use it and Logger interchangeably.
29
+
30
+ ```ruby
31
+ require 'tidy_logger'
32
+
33
+ logger = TidyLogger.new(STDOUT)
34
+ logger.info 'hello world!' # => "I, [2013-03-21T19:46:31.703381 #27585] INFO -- : hello world!\n"
35
+ ```
36
+
37
+ The only method that's added to Logger is `config` - when you call it, all the shapeshifting happens.
38
+
39
+ Supported options are `plain`, `time`, `title`, `time_and_level` (chosen when no argument is given), `ltsv` ([Labeled Tab-Separated Values](http://ltsv.org)) and lambdas.
40
+
41
+ ```ruby
42
+ logger = TidyLogger.new(STDOUT)
43
+
44
+ logger.config
45
+ logger.info 'hello' # => "[2013-03-21T21:19:54] INFO : hello"
46
+
47
+ logger.config(:plain)
48
+ logger.info 'hello' # => "hello"
49
+
50
+ logger.config(:time)
51
+ logger.info 'hello' # => "[2013-03-21T21:19:10] hello"
52
+
53
+ logger.config(title: 'note')
54
+ logger.info 'hello' # => "[note] hello"
55
+
56
+ logger.config(:ltsv)
57
+ logger.info fizz: 1, buzz: 2 # => "fizz:1\tbuzz:2"
58
+
59
+ logger.config lambda{|_,_,_,msg| "///do crazy stuff/// #{msg}\n" }
60
+ logger.info 'hello' # => "///do crazy stuff/// hello"
61
+ ```
20
62
 
21
- TODO: Write usage instructions here
63
+ The `config` method returns self, so that you can tidy up in method chain.
22
64
 
23
- ## Contributing
65
+ ```ruby
66
+ logger = TidyLogger.new(STDOUT).config(:plain)
24
67
 
25
- 1. Fork it
26
- 2. Create your feature branch (`git checkout -b my-new-feature`)
27
- 3. Commit your changes (`git commit -am 'Add some feature'`)
28
- 4. Push to the branch (`git push origin my-new-feature`)
29
- 5. Create new Pull Request
68
+ logger.config(:plain).info 'foo'
69
+ ```
@@ -1,15 +1,12 @@
1
1
  # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'tidy_logger/version'
5
2
 
6
3
  Gem::Specification.new do |spec|
7
4
  spec.name = 'tidy_logger'
8
- spec.version = TidyLogger::VERSION
5
+ spec.version = '1.0.1' # retrieve this value by: Gem.loaded_specs['redis-mutex'].version.to_s
9
6
  spec.authors = ['Kenn Ejima']
10
7
  spec.email = ['kenn.ejima@gmail.com']
11
- spec.description = %q{TidyLogger: Logger on Steroids}
12
- spec.summary = %q{TidyLogger: Logger on Steroids}
8
+ spec.description = %q{TidyLogger: Better API for Ruby’s stdlib Logger}
9
+ spec.summary = %q{TidyLogger: Better API for Ruby’s stdlib Logger}
13
10
  spec.homepage = 'https://github.com/kenn/tidy_logger'
14
11
  spec.license = 'MIT'
15
12
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tidy_logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenn Ejima
@@ -38,7 +38,7 @@ dependencies:
38
38
  - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- description: 'TidyLogger: Logger on Steroids'
41
+ description: 'TidyLogger: Better API for Ruby’s stdlib Logger'
42
42
  email:
43
43
  - kenn.ejima@gmail.com
44
44
  executables: []
@@ -52,7 +52,6 @@ files:
52
52
  - README.md
53
53
  - Rakefile
54
54
  - lib/tidy_logger.rb
55
- - lib/tidy_logger/version.rb
56
55
  - test/test_tidy_logger.rb
57
56
  - tidy_logger.gemspec
58
57
  homepage: https://github.com/kenn/tidy_logger
@@ -78,7 +77,7 @@ rubyforge_project:
78
77
  rubygems_version: 2.0.3
79
78
  signing_key:
80
79
  specification_version: 4
81
- summary: 'TidyLogger: Logger on Steroids'
80
+ summary: 'TidyLogger: Better API for Ruby’s stdlib Logger'
82
81
  test_files:
83
82
  - test/test_tidy_logger.rb
84
83
  has_rdoc:
@@ -1,3 +0,0 @@
1
- class TidyLogger
2
- VERSION = '1.0.0'
3
- end