json_ruby_logger 0.1.5 → 0.1.7

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
  SHA256:
3
- metadata.gz: d54a10d53e83e69e49606a42420dea9540cfd30c078afe1a9b34b6ae2640380a
4
- data.tar.gz: 13b3b25e9bf946155f6ffcfacb57b07c9ae0926af755da273fd1647683f3b95f
3
+ metadata.gz: a9890c5816d4ec3c8f15a56a90f5a87482fd8c3db9e84c7cad4174fe5df50311
4
+ data.tar.gz: 97264eb17de0964080f5a7a11067a99c529e81a1d2387377327034afbef613b9
5
5
  SHA512:
6
- metadata.gz: e3b15e905b9fbfa963f1d822d1d583ba32649dc0c67a778b237ce557e90e7ce651bbe03e011aa3a52c3705c02412e73249c4bc3ea729fe33738a90f8c7179374
7
- data.tar.gz: 76593234c12c2fc24215dc722665e7a972e24eff331b3cecc90ad582594f1b02ded2b9edac7df313d857c18b52295e29d2b3ea422c2a7c5e1f4345195fe6c502
6
+ metadata.gz: f2c3f71174fd7103c62dc48e8a51a4813238a0cb5b16343466be0126e58baca086d539f400db2c1ab8c8628bc85418f827b9e7f84d86a3650dcd3d0cc190b58d
7
+ data.tar.gz: bd27c605b4cba7e8672d8a6e6b744a5f4d856fb33e85933e6fa3b00704d89c319a40c908c22edd51d77cf362b8236087c1315639f93312c556209e8dee8b3e3a
data/.editorconfig CHANGED
@@ -8,4 +8,4 @@ charset = utf-8
8
8
  trim_trailing_whitespace = true
9
9
  insert_final_newline = true
10
10
 
11
- max_line_length = 110
11
+ max_line_length = 300
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- json_ruby_logger (0.1.5)
4
+ json_ruby_logger (0.1.6)
5
5
  json (~> 2.6)
6
6
  logger (~> 1.5)
7
7
  time (~> 0.2)
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # JsonRubyLogger
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/json_ruby_logger.svg)](https://badge.fury.io/rb/json_ruby_logger)
4
+
3
5
  A simpe ruby [logger](https://ruby-doc.org/3.2.2/stdlibs/logger/Logger.html) that logs in json format with the below information.
4
6
 
5
7
  ```json
@@ -19,7 +21,7 @@ A simpe ruby [logger](https://ruby-doc.org/3.2.2/stdlibs/logger/Logger.html) tha
19
21
 
20
22
  - [Installation](#installation)
21
23
  - [Usage](#usage)
22
- - [Examples](##examples)
24
+ - [Examples](#examples)
23
25
  - [Example 1 - Single file](#example-1)
24
26
  - [Example 2 - Multiple files file](#example-2)
25
27
 
@@ -47,9 +49,9 @@ Example 1 - Single function in a single file called `test_logging.rb`:
47
49
 
48
50
 
49
51
  ```ruby
50
- include Logging
52
+ include JsonRubyLogger
51
53
  def test
52
- logger.info { "Hello World call from #{self.class.name}" }
54
+ logger.info("Hello World call from #{self.class.name}")
53
55
  end
54
56
 
55
57
  test
@@ -63,6 +65,8 @@ Output from example 1:
63
65
  {"date":"2023-07-06T15:10:24+10:00","file_name":"test_logger.rb","calling_class":"Object","function_name":"test","lineno":31,"severity":"INFO","pid":44665,"message":"Hello World call from Object"}
64
66
  ```
65
67
 
68
+ #### Example 2
69
+
66
70
  Example 2 in a single files called `test_logging.rb`:
67
71
 
68
72
  ```ruby
@@ -73,12 +77,12 @@ module LogTest
73
77
  include JsonRubyLogger
74
78
 
75
79
  def call
76
- logger.info { "Hello World call from #{self.class.name}" }
80
+ logger.info("Hello World call from #{self.class.name}")
77
81
  call2
78
82
  end
79
83
 
80
84
  def call2
81
- logger.info { "Hello World call2 from #{self.class.name}" }
85
+ logger.info("Hello World call2 from #{self.class.name}")
82
86
  end
83
87
  end
84
88
  end
@@ -88,12 +92,12 @@ class TestLogging2
88
92
  include JsonRubyLogger
89
93
 
90
94
  def call
91
- logger.info { "Hello World call from #{self.class.name}" }
95
+ logger.info("Hello World call from #{self.class.name}")
92
96
  call2
93
97
  end
94
98
 
95
99
  def call2
96
- logger.info { "Hello World call2 from #{self.class.name}" }
100
+ logger.info("Hello World call2 from #{self.class.name}")
97
101
  end
98
102
  end
99
103
 
@@ -125,12 +129,12 @@ class AnotherClass
125
129
  include JsonRubyLogger
126
130
 
127
131
  def another_class_call
128
- logger.info { "AnotherClass Hello World call from #{self.class.name}" }
132
+ logger.info("AnotherClass Hello World call from #{self.class.name}")
129
133
  another_class
130
134
  end
131
135
 
132
136
  def another_class
133
- logger.info { "Hello World call2 from #{self.class.name}" }
137
+ logger.info("Hello World call2 from #{self.class.name}")
134
138
  end
135
139
  end
136
140
  ```
@@ -145,12 +149,12 @@ class TestLogging
145
149
  include JsonRubyLogger
146
150
 
147
151
  def call
148
- logger.info { "Hello World call from #{self.class.name}" }
152
+ logger.info("Hello World call from #{self.class.name}")
149
153
  another_class
150
154
  end
151
155
 
152
156
  def another_class
153
- logger.info { "Hello World call2 from #{self.class.name}" }
157
+ logger.info("Hello World call2 from #{self.class.name}")
154
158
  AnotherClass.new.another_class_call
155
159
  end
156
160
  end
@@ -203,3 +207,10 @@ bundle gem json_ruby_logger \
203
207
  ```bash
204
208
  gem yank json_ruby_logger -v 0.1.0
205
209
  ```
210
+
211
+ ## Bump Gem Version
212
+
213
+ ```bash
214
+ gem install gem-release
215
+ gem bump patch --skip-ci --push
216
+ ```
@@ -6,7 +6,6 @@ Gem::Specification.new do |spec|
6
6
  spec.name = "json_ruby_logger"
7
7
  spec.version = JsonRubyLogger::VERSION
8
8
  spec.authors = ["ml"]
9
- spec.email = ["redacted@gmail.com"]
10
9
 
11
10
  spec.summary = "Simple JSON logging for Ruby, including classnames, filenames, linenos, timestamps, and log levels."
12
11
  spec.description = "Simple JSON logging for Ruby"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JsonRubyLogger
4
- VERSION = "0.1.5"
4
+ VERSION = "0.1.7"
5
5
  end
@@ -12,7 +12,7 @@ module JsonRubyLogger
12
12
  # This is the magical bit that gets mixed into your classes
13
13
  def logger
14
14
  # caller_locations returns an array of Thread::Backtrace::Location
15
- JsonRubyLogger.logger(self.class.name, caller_locations.first)
15
+ @logger ||= JsonRubyLogger.logger(self.class.name, caller_locations.first)
16
16
  end
17
17
 
18
18
  # Global, memoized, lazy initialised instance of a logger
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json_ruby_logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - ml
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-07-06 00:00:00.000000000 Z
11
+ date: 2023-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logger
@@ -54,7 +54,6 @@ dependencies:
54
54
  version: '0.2'
55
55
  description: Simple JSON logging for Ruby
56
56
  email:
57
- - redacted@gmail.com
58
57
  executables: []
59
58
  extensions: []
60
59
  extra_rdoc_files: []