flnt 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9598b2d9ec5edeb6b7bb130e680583098930677d
4
- data.tar.gz: 63dbc73fe1f99ce3e4727d43932828f0a7431e5a
3
+ metadata.gz: 11f597c1c684124be6cbbc17b8b2fa388aa68ea6
4
+ data.tar.gz: 1f2b8774e99a066dcafd5032b1e0fd2d9447c109
5
5
  SHA512:
6
- metadata.gz: c3af8c77dfd7b650dcf05c5c09e71f3d5d996e9d7cbd520129ea21e51b04aae9d52311c0743d108d900b53a917671b7b27bba2a7953745f87ba069fbecd1e0c7
7
- data.tar.gz: b5e50e8c86511c7cdc39a2be85f7e6a5c6580215403e57ce5b412e5185cc8e2ac62b135bd4f655d7d08107e89c9f11b6b9183ec46f0e2af5185eb01429a98385
6
+ metadata.gz: 7dd93d150a0e618ca658560ae9b98d13b5c58c345899dfbda1f2d3c590a223850ed613333c00aaf0bbc89c32af27fb520b0b5e1c9596f406d0edc552bcab637e
7
+ data.tar.gz: b3d4a5c6cd88a13509e93a8351d6393966cecced7b23016c9ee0b754500ad9baf2c0c796e13564f91b8c0fbecc1da799a6c58443fb1d8d8df8233e639b95add1
data/.gitignore CHANGED
@@ -15,3 +15,5 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+
19
+ *_flymake.rb
data/README.md CHANGED
@@ -2,23 +2,23 @@
2
2
 
3
3
  Gentle post-to-fluentd log solution.
4
4
 
5
+ [![Gem Version](https://badge.fury.io/rb/flnt.png)](http://badge.fury.io/rb/flnt)
6
+
5
7
  ## Powered by wercker
6
8
 
7
9
  [![wercker status](https://app.wercker.com/status/4c5b18d2fe3debeee48b7f0fab81eb12/m/ "wercker status")](https://app.wercker.com/project/bykey/4c5b18d2fe3debeee48b7f0fab81eb12)
8
10
 
9
11
  ## Installation
10
12
 
11
- Add this line to your application's Gemfile:
12
-
13
- gem 'flnt'
14
-
15
- And then execute:
13
+ Usual Gemfile way:
16
14
 
17
- $ bundle
18
-
19
- Or install it yourself as:
15
+ ```ruby
16
+ gem 'flnt'
17
+ ```
20
18
 
21
- $ gem install flnt
19
+ ```bash
20
+ $ bundle install
21
+ ```
22
22
 
23
23
  ## Usage
24
24
 
@@ -36,6 +36,15 @@ it emits the information to fluentd.
36
36
 
37
37
  NOTE: You cannot use methods such as `foo?` or `foo!` for tag suffix. only `/[a-zA-Z0-9_]/` are OK.
38
38
 
39
+ ### Force custome tag
40
+
41
+ ```ruby
42
+ Flnt.tag!("app.event.login.info").emit! "Logged in: #{current_user.name}"
43
+ ```
44
+
45
+ `Flunt.tag!` initializes logger with a tag, and `Flnt::Logger#emit!` will just send a data to fluentd
46
+ without appending a tag suffix.
47
+
39
48
  ### Configuration of fluentd
40
49
 
41
50
  ```ruby
data/lib/flnt/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Flnt
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/lib/flnt.rb CHANGED
@@ -31,5 +31,9 @@ module Flnt
31
31
  Fluent::Logger::FluentLogger.open(*Flnt::Configuration())
32
32
  end
33
33
  end
34
+
35
+ def tag!(tag)
36
+ Flnt::Logger.new(tag.to_s)
37
+ end
34
38
  end
35
39
  end
@@ -33,4 +33,9 @@ describe "Flnt" do
33
33
  logger2 = Flnt.foo_tag
34
34
  expect(logger1.__id__).not_to eq logger2.__id__
35
35
  end
36
+
37
+ it "should create a new logger with custom tag" do
38
+ logger = Flnt.tag!("foo.bar.buz")
39
+ expect(logger.instance_eval { @tag }).to eq "foo.bar.buz"
40
+ end
36
41
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flnt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Uchio KONDO
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-19 00:00:00.000000000 Z
11
+ date: 2014-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluent-logger
@@ -98,7 +98,6 @@ files:
98
98
  - lib/flnt/configuration.rb
99
99
  - lib/flnt/logger.rb
100
100
  - lib/flnt/version.rb
101
- - lib/flnt/version_flymake.rb
102
101
  - spec/lib/flnt/configuration_spec.rb
103
102
  - spec/lib/flnt/logger_spec.rb
104
103
  - spec/lib/flnt_spec.rb
@@ -1,3 +0,0 @@
1
- module Flnt
2
- VERSION = "0.1.0"
3
- end