rt-logman 0.12.0 → 1.0.0

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: 33569fa0727a96e335b0b8a6c70ecaaf5f575793
4
- data.tar.gz: 5cd0831f149099f44ffded9bf4284411bd6e308b
3
+ metadata.gz: 15be3c449a0a876ee2386230fcdb4fd90ba33f6c
4
+ data.tar.gz: 65c355865f197a0446896ebe0ff4150f49169ffd
5
5
  SHA512:
6
- metadata.gz: 3e2fccba22a26a3afe05f0d0dd79b59f7849a2687e2d4647671b229644f7ee80c7a9f198581ab6284dd7acc2d496580b42eb3c8131507142033bc46dba02440c
7
- data.tar.gz: 492d8d201abb4740de1d3cecefb1ec5cc37294854117cb2c5a463b12f98020eeea3cf32c5e0ee569f02fe636f7029ad512c53a3cfcf8cde1a1a91510c74f6514
6
+ metadata.gz: bddcf0c092468aa3fa249e35c31931a915ca385a2bcfad23f2f74e0ae89878fae744c1f712b0d7793bb7c0cac1ea20d0cf28eba06d244ec4e95b1ad74e4943e7
7
+ data.tar.gz: b4fcc9e9efd41039f699326c24ff2410630b6ba37cea218783872255f7825751acd6069a7ea0f9ead3810894bafce98693efe44644eab6ef082b3d87c2e06d57
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rt-logman (0.12.0)
4
+ rt-logman (1.0.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -85,4 +85,4 @@ DEPENDENCIES
85
85
  timecop (~> 0.9)
86
86
 
87
87
  BUNDLED WITH
88
- 1.16.0
88
+ 1.16.1
data/README.md CHANGED
@@ -62,7 +62,7 @@ FATAL > ERROR > WARN > INFO > DEBUG
62
62
  ## Instantiated Loggers
63
63
 
64
64
  Logs in a class or system component usually share common metadata fields. For
65
- this purpose, an new instance of Logman can be created and pre-populated with
65
+ this purpose, a new instance of Logman can be created and pre-populated with
66
66
  metadata.
67
67
 
68
68
  In the following example, we will add logs to a video processor:
@@ -74,7 +74,7 @@ class VideoProcessor
74
74
  @logger = Logman.new
75
75
 
76
76
  # these fields will appear in every log event
77
- @logger.add(:compoent => "video_processor")
77
+ @logger.add(:component => "video_processor")
78
78
  @logger.add(:id => @video.id)
79
79
  @logger.add(:title => "Keyboard Cat")
80
80
  end
@@ -106,18 +106,18 @@ end
106
106
  In case of a successful processing of a video, we would see the following:
107
107
 
108
108
  ``` txt
109
- {"level":"INFO","time":"2017-12-12 09:35:19 +0000","pid":10950,"message":"started","compoent":"video_processor","id":9312,"title":"Keyboard Cat"}
110
- {"level":"INFO","time":"2017-12-12 09:35:34 +0000","pid":10950,"message":"loaded into memory","compoent":"video_processor","id":9312,"title":"Keyboard Cat","size":41241241}
111
- {"level":"INFO","time":"2017-12-12 09:35:44 +0000","pid":10950,"message":"compressed","compoent":"video_processor","id":9312,"title":"Keyboard Cat","size":1312312}
112
- {"level":"INFO","time":"2017-12-12 09:36:08 +0000","pid":10950,"message":"uploaded to S3","compoent":"video_processor","id":9312,"title":"Keyboard Cat","s3_path":"s3://hehe/a.mpeg"}
113
- {"level":"INFO","time":"2017-12-12 09:36:27 +0000","pid":10950,"message":"finished","compoent":"video_processor","id":9312,"title":"Keyboard Cat"}
109
+ {"level":"INFO","time":"2017-12-12 09:35:19 +0000","pid":10950,"message":"started","component":"video_processor","id":9312,"title":"Keyboard Cat"}
110
+ {"level":"INFO","time":"2017-12-12 09:35:34 +0000","pid":10950,"message":"loaded into memory","component":"video_processor","id":9312,"title":"Keyboard Cat","size":41241241}
111
+ {"level":"INFO","time":"2017-12-12 09:35:44 +0000","pid":10950,"message":"compressed","component":"video_processor","id":9312,"title":"Keyboard Cat","size":1312312}
112
+ {"level":"INFO","time":"2017-12-12 09:36:08 +0000","pid":10950,"message":"uploaded to S3","component":"video_processor","id":9312,"title":"Keyboard Cat","s3_path":"s3://hehe/a.mpeg"}
113
+ {"level":"INFO","time":"2017-12-12 09:36:27 +0000","pid":10950,"message":"finished","component":"video_processor","id":9312,"title":"Keyboard Cat"}
114
114
  ```
115
115
 
116
116
  In case of an error, we would see the following:
117
117
 
118
118
  ``` txt
119
- {"level":"INFO","time":"2017-12-12 09:35:19 +0000","pid":10950,"message":"started","compoent":"video_processor","id":9312,"title":"Keyboard Cat"}
120
- {"level":"ERROR","time":"2017-12-12 09:35:34 +0000","pid":10950,"message":"failed","compoent":"video_processor","id":9312,"title":"Keyboard Cat","size":41241241,"exception": "Out of memory"}
119
+ {"level":"INFO","time":"2017-12-12 09:35:19 +0000","pid":10950,"message":"started","component":"video_processor","id":9312,"title":"Keyboard Cat"}
120
+ {"level":"ERROR","time":"2017-12-12 09:35:34 +0000","pid":10950,"message":"failed","component":"video_processor","id":9312,"title":"Keyboard Cat","size":41241241,"exception": "Out of memory"}
121
121
  ```
122
122
 
123
123
  Logman can receive a [Ruby Logger](http://ruby-doc.org/stdlib-2.2.0/libdoc/logger/rdoc/Logger.html)
@@ -180,7 +180,7 @@ The above will log the following information:
180
180
  {"level":"INFO","time":"2017-12-12 09:40:39 +0000","pid":10950,"message":"user-registration-finished","username":"shiroyasha"}
181
181
  ```
182
182
 
183
- In case of an exception, the error will be logger and re-thrown:
183
+ In case of an exception, the error will be logged and re-thrown:
184
184
 
185
185
  ``` ruby
186
186
  Logman.process("user-registration", :username => "shiroyasha") do |logger|
@@ -1,3 +1,3 @@
1
1
  class Logman
2
- VERSION = "0.12.0".freeze
2
+ VERSION = "1.0.0".freeze
3
3
  end
data/lib/logman.rb CHANGED
@@ -67,14 +67,14 @@ class Logman
67
67
 
68
68
  result
69
69
  rescue StandardError => exception
70
- logger.error("#{name}-failed", :type => exception.class.name, :message => exception.message)
70
+ logger.error("#{name}-failed", :type => exception.class.name, :msg => exception.message)
71
71
  raise
72
72
  end
73
73
 
74
74
  private
75
75
 
76
76
  def log(level, message, metadata = {})
77
- @logger.public_send(level, { :message => message }.merge(@fields).merge(metadata))
77
+ @logger.public_send(level, { :msg => message }.merge(@fields).merge(metadata))
78
78
  end
79
79
 
80
80
  def formatter
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rt-logman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rendered Text
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-12-18 00:00:00.000000000 Z
11
+ date: 2018-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler