logdna 1.1.1 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +5 -13
  2. data/README.md +6 -0
  3. data/lib/logdna.rb +4 -3
  4. data/lib/logdna/version.rb +1 -1
  5. metadata +22 -22
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MTFjNGZmNzhlOWRmMDIxZWM3M2RmYmU3ODg0NzViMmRlZTQ1ZWZhZA==
5
- data.tar.gz: !binary |-
6
- MmJlZDQ1NWY5ZTJhN2ZjOGJhOGM2OTQ4ZmZiZWRhNWMxM2JiYzE5Yw==
2
+ SHA1:
3
+ metadata.gz: 6222bf49a91e32f57729e06f85badea969f6bacb
4
+ data.tar.gz: 0b33b7292fa1072b81f978f07f331b369eabc9ee
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- NmJjMDM5ZTUzOTFjNjMwN2ZkZTU0YWNkNjRiNjk3YTVkY2IxNTQzMTNmMTE2
10
- NDRjYTc4NDYyNDI5ZTM1NTdjNjkyNGRmYzBhYmMxMWRmOWJlMDJmZTMxYzEz
11
- ODdjM2Y3MjdkYmQzZDQyMjU1YzViZThmYmVjMzkxN2RmOGE3ODg=
12
- data.tar.gz: !binary |-
13
- MTk0OTFjYjAxZTVkOGNhN2JkZTRhYmIxMjcxOGQ2MjBjMWE0YjA4NjMzYTFi
14
- NDE2ZjU5NjljYjAwNTZhYmJiOWY4YzA3Yjc0NzFiYWUwZmVkZWQ3Y2Y3ZGI5
15
- NzQyZDEwYmU4YTU1ZGFjYWI2MThkMzgyNDgwZjY1YTA1ZWRmY2E=
6
+ metadata.gz: 73b0894e04ca5246b7d2906a8b333f947b4c43c750938f7cb8c06ae3610bedd1b43bc3bc94a661ff4a54bf768279d1404abd4d76f258893aba3effb7dc09afe8
7
+ data.tar.gz: 5d47c9ec27b2e620c7967d03312e1209b47cfb57107f480613f611e85d98400ec120572e4788d55d9301740c9a302daa7d43bcf7eb79cb5ba362bddc87d7322a
data/README.md CHANGED
@@ -58,6 +58,11 @@ To send logs, use "log" method. Default log level is "INFO"
58
58
  logger.log('This is my first log')
59
59
  => "Saved" # Saved to buffer. Ready to be flushed automatically
60
60
 
61
+ Optionally you can use a block to do so
62
+
63
+ logger.log { 'This is my second log' }
64
+ => "Saved"
65
+
61
66
  Log a message with particular metadata, level, appname, environment (one-time)
62
67
 
63
68
  logger.log('This is warn message', {:meta => {:meta => "data"}, :level => "WARN", :app => "awesome", :env => "DEVELOPMENT"})
@@ -83,6 +88,7 @@ Log a message with a particular level easily
83
88
 
84
89
  logger.warn('This is a warning message')
85
90
  logger.fatal('This is a fatal message')
91
+ logger.debug { 'This is a debug message' }
86
92
 
87
93
 
88
94
  Hostname and app name cannot be more than 80 characters.
@@ -83,7 +83,8 @@ module Logdna
83
83
 
84
84
  def log(msg=nil, opts={})
85
85
  loggerExist?
86
- @response = @@client.buffer(msg, default_opts.merge(opts).merge({
86
+ message = yield if msg.nil? && block_given?
87
+ @response = @@client.buffer(message, default_opts.merge(opts).merge({
87
88
  timestamp: (Time.now.to_f * 1000).to_i
88
89
  }))
89
90
  'Saved'
@@ -92,10 +93,10 @@ module Logdna
92
93
  Resources::LOG_LEVELS.each do |lvl|
93
94
  name = lvl.downcase
94
95
 
95
- define_method name do |msg=nil, opts={}|
96
+ define_method name do |msg=nil, opts={}, &block|
96
97
  self.log(msg, opts.merge({
97
98
  level: lvl,
98
- }))
99
+ }), &block)
99
100
  end
100
101
 
101
102
  define_method "#{name}?" do
@@ -1,3 +1,3 @@
1
1
  module LogDNA
2
- VERSION = '1.1.1'.freeze
2
+ VERSION = '1.2.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,111 +1,111 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logdna
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gun Woo Choi, Derek Zhou
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-10-23 00:00:00.000000000 Z
11
+ date: 2018-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: require_all
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.4'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.4'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: json
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '2.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '2.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '1.13'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1.13'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: '10.5'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ~>
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '10.5'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rspec
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ~>
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
89
  version: '3.5'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ~>
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '3.5'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: webmock
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ~>
101
+ - - "~>"
102
102
  - !ruby/object:Gem::Version
103
103
  version: '2.3'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ~>
108
+ - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '2.3'
111
111
  description:
@@ -114,9 +114,9 @@ executables: []
114
114
  extensions: []
115
115
  extra_rdoc_files: []
116
116
  files:
117
- - .gitignore
118
- - .rspec
119
- - .ruby-version
117
+ - ".gitignore"
118
+ - ".rspec"
119
+ - ".ruby-version"
120
120
  - Gemfile
121
121
  - LICENSE.txt
122
122
  - README.md
@@ -137,17 +137,17 @@ require_paths:
137
137
  - lib
138
138
  required_ruby_version: !ruby/object:Gem::Requirement
139
139
  requirements:
140
- - - ! '>='
140
+ - - ">="
141
141
  - !ruby/object:Gem::Version
142
142
  version: '0'
143
143
  required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  requirements:
145
- - - ! '>='
145
+ - - ">="
146
146
  - !ruby/object:Gem::Version
147
147
  version: '0'
148
148
  requirements: []
149
149
  rubyforge_project:
150
- rubygems_version: 2.6.11
150
+ rubygems_version: 2.5.2
151
151
  signing_key:
152
152
  specification_version: 4
153
153
  summary: LogDNA Ruby logger