mr_loga_loga 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/release.yml +2 -2
  3. data/.gitignore +1 -0
  4. data/.yardopts +1 -0
  5. data/CHANGELOG.md +17 -0
  6. data/Gemfile.lock +7 -3
  7. data/README.md +4 -4
  8. data/docs/MrLogaLoga/Configuration.html +376 -0
  9. data/docs/MrLogaLoga/Context.html +628 -0
  10. data/docs/MrLogaLoga/Error.html +124 -0
  11. data/docs/MrLogaLoga/Extensions/LogrageExtension.html +305 -0
  12. data/docs/MrLogaLoga/Extensions/RailsExtension/LoggerPatch.html +322 -0
  13. data/docs/MrLogaLoga/Extensions/RailsExtension/ServerPatch.html +201 -0
  14. data/docs/MrLogaLoga/Extensions/RailsExtension.html +242 -0
  15. data/docs/MrLogaLoga/Extensions.html +117 -0
  16. data/docs/MrLogaLoga/Formatters/Json.html +350 -0
  17. data/docs/MrLogaLoga/Formatters/KeyValue.html +338 -0
  18. data/docs/MrLogaLoga/Formatters.html +117 -0
  19. data/docs/MrLogaLoga/InstanceMethods.html +350 -0
  20. data/docs/MrLogaLoga/Logger.html +618 -0
  21. data/docs/MrLogaLoga/LoggerProxy.html +319 -0
  22. data/docs/MrLogaLoga.html +374 -0
  23. data/docs/_config.yml +1 -0
  24. data/docs/_index.html +280 -0
  25. data/docs/class_list.html +51 -0
  26. data/docs/css/common.css +1 -0
  27. data/docs/css/full_list.css +58 -0
  28. data/docs/css/style.css +497 -0
  29. data/docs/file.README.html +255 -0
  30. data/docs/file_list.html +56 -0
  31. data/docs/frames.html +17 -0
  32. data/docs/index.html +255 -0
  33. data/docs/js/app.js +314 -0
  34. data/docs/js/full_list.js +216 -0
  35. data/docs/js/jquery.js +4 -0
  36. data/docs/method_list.html +283 -0
  37. data/docs/top-level-namespace.html +110 -0
  38. data/lib/mr_loga_loga/context.rb +10 -0
  39. data/lib/mr_loga_loga/extensions/{lograge_patch.rb → lograge.rb} +19 -6
  40. data/lib/mr_loga_loga/extensions/rails.rb +142 -0
  41. data/lib/mr_loga_loga/instance_methods.rb +5 -1
  42. data/lib/mr_loga_loga/logger.rb +3 -5
  43. data/lib/mr_loga_loga/version.rb +1 -1
  44. data/lib/mr_loga_loga.rb +3 -3
  45. data/mr_loga_loga.gemspec +3 -2
  46. metadata +53 -8
  47. data/lib/mr_loga_loga/extensions/active_support_logger_patch.rb +0 -94
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 96771984713e671c4d386e6f2736e7f5fd1e929912a8536f735df46f5df80de1
4
- data.tar.gz: 636178d39697f664b5093b49758c478a5dc3739bfceadf03d092ebd777c5d861
3
+ metadata.gz: 9302fc69d4d56866600c8d8fb20eedf503dd21d4749b4bc737614ecc73f4569a
4
+ data.tar.gz: 9e064b34de99a0fa1e624d2969cae8bfa2f1e425f1e53781243bf8c54c314c1a
5
5
  SHA512:
6
- metadata.gz: cee5fb5dd81654e5f32fdcc061a23de27e93b6f3dd5d514f2e8a0009b71a795014dc7b4077c4129c614ac96b26369e80e217e8dea25c56c9009d765b92204d7a
7
- data.tar.gz: d53465a1153ab221eb2b4039dd987dc56ced93a0ece700fd653f7464bc95f5975a69f6e71cc894c3e3b6d03593c2e45b8be21f6a345304ef8286b97d3fd669a1
6
+ metadata.gz: cd158e43d67fc8988387b247199768ba72b0e349860ad065b30c29b8a17a400dd7023b3587c8bd350f453818c489110d00975fbfe07da13dc07af76795bc4800
7
+ data.tar.gz: ce8770ac8a506652642ac564ed585be8b3b8f935b20afb1cd2162d732b44b09cc79d346aaca7d23858f4b3033861d19aff3259e31e16fc653960f5501ff421ff
@@ -19,7 +19,7 @@ jobs:
19
19
  steps:
20
20
  - uses: actions/checkout@v2
21
21
  - name: Generate Release 🗒️
22
- uses: GoogleCloudPlatform/release-please-action@v2
22
+ uses: GoogleCloudPlatform/release-please-action@v3
23
23
  id: release
24
24
  with:
25
25
  release-type: ruby
@@ -75,5 +75,5 @@ jobs:
75
75
  - name: Commit Updated Files 📤
76
76
  uses: EndBug/add-and-commit@v7
77
77
  with:
78
- add: "['Gemfile.lock', 'package.json', 'package-lock.json']"
78
+ add: "['Gemfile.lock']"
79
79
  message: "chore: post-release ${{ steps.release-version.outputs.version }}"
data/.gitignore CHANGED
@@ -188,3 +188,4 @@ tags
188
188
  # End of https://www.toptal.com/developers/gitignore/api/vim,rubymine+all,rails
189
189
 
190
190
  .rspec_status
191
+ .yardoc
data/.yardopts ADDED
@@ -0,0 +1 @@
1
+ --output-dir docs
data/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ### [0.1.2](https://github.com/hschne/mr-loga-loga/compare/v0.1.1...v0.1.2) (2022-01-05)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * improve rails patch ([a31cdf1](https://github.com/hschne/mr-loga-loga/commit/a31cdf1b655bfaeb2351bff818ca0af83293ace5))
9
+ * only delegate when logger is loga loga ([55bd0db](https://github.com/hschne/mr-loga-loga/commit/55bd0dbdee5b975c80effac90e989eb08d2b6948))
10
+
11
+ ### [0.1.1](https://www.github.com/hschne/mr-loga-loga/compare/v0.1.0...v0.1.1) (2022-01-03)
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * rails compatibility ([81619ef](https://www.github.com/hschne/mr-loga-loga/commit/81619ef76d772ac05eb78daf3714794d345af587))
17
+ * remove byebug, patch rails, fix logger proxy ([38caf62](https://www.github.com/hschne/mr-loga-loga/commit/38caf625304449e128e9201aeeaf79d24798aa7d))
18
+ * update initializer signature ([bdd8b72](https://www.github.com/hschne/mr-loga-loga/commit/bdd8b7269111550ff9e2e5e3c6344d6c83707099))
19
+
3
20
  ## [0.1.0] - 2021-11-12
4
21
 
5
22
  - Initial release
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mr_loga_loga (0.1.1)
4
+ mr_loga_loga (0.1.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -49,6 +49,9 @@ GEM
49
49
  simplecov_json_formatter (0.1.3)
50
50
  timecop (0.9.4)
51
51
  unicode-display_width (2.1.0)
52
+ webrick (1.7.0)
53
+ yard (0.9.27)
54
+ webrick (~> 1.7.0)
52
55
 
53
56
  PLATFORMS
54
57
  x86_64-linux
@@ -58,8 +61,9 @@ DEPENDENCIES
58
61
  rake (~> 13.0)
59
62
  rspec (~> 3.0)
60
63
  rubocop (~> 1.7)
61
- simplecov (~> 0.21.2)
62
- timecop (~> 0.9.4)
64
+ simplecov (~> 0.21)
65
+ timecop (~> 0.9)
66
+ yard (~> 0.9)
63
67
 
64
68
  BUNDLED WITH
65
69
  2.2.26
data/README.md CHANGED
@@ -13,7 +13,8 @@
13
13
 
14
14
  ## What's this?
15
15
 
16
- MrLogaLoga is a logger for Ruby that allows you to easily attach contextual information to your log messages. When writing logs, messages only tell half the story. MrLogaLoga allows you to make the most of your logs:
16
+ MrLogaLoga is a logger for Ruby that allows you to easily attach contextual information to your log messages.
17
+ When writing logs, messages only tell half the story. MrLogaLoga allows you to make the most of your logs.
17
18
 
18
19
  ```ruby
19
20
  logger.info('message', user: 'name', data: 1)
@@ -40,7 +41,7 @@ bundle install
40
41
 
41
42
  ## Usage
42
43
 
43
- MrLogaLoga provides the same interface as the Ruby default logger you are used to. In addition, however, you can attach contextual information to your log messages:
44
+ MrLogaLoga provides the same interface as the Ruby default logger you are used to. In addition, however, you can attach contextual information to your log messages.
44
45
 
45
46
  ```ruby
46
47
  require 'mr_loga_loga'
@@ -66,7 +67,7 @@ logger.user('name').info('message') # Dynamic context method
66
67
  logger.user { 'name' }.info('message') # Dynamic context block
67
68
  ```
68
69
 
69
- The block syntax [ is recommended when logging calculated properties ](https://ruby-doc.org/stdlib-2.4.0/libdoc/logger/rdoc/Logger.html#class-Logger-label-How+to+log+a+message).
70
+ The block syntax [ is recommended when logging calculated properties ](https://ruby-doc.org/stdlib-2.4.0/libdoc/logger/rdoc/Logger.html#class-Logger-label-How+to+log+a+message). You can find more in-depth information about specific method in the [Code Documentation](https://www.hschne.at/mr-loga-loga/).
70
71
 
71
72
  #### Shared Context
72
73
 
@@ -112,7 +113,6 @@ class MyClass
112
113
  end
113
114
  ```
114
115
 
115
-
116
116
  ### Formatters
117
117
 
118
118
  MrLogaLoga uses the [KeyValue](https://github.com/hschne/mr-loga-loga/blob/main/lib/mr_loga_loga/formatters/key_value.rb) formatter per default. The [Json](https://github.com/hschne/mr-loga-loga/blob/main/lib/mr_loga_loga/formatters/json.rb) formatter is also included. To use a specific formatter pass it to the logger constructor:
@@ -0,0 +1,376 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Class: MrLogaLoga::Configuration
8
+
9
+ &mdash; Documentation by YARD 0.9.27
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" />
16
+
17
+ <script type="text/javascript">
18
+ pathId = "MrLogaLoga::Configuration";
19
+ relpath = '../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../_index.html">Index (C)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../MrLogaLoga.html" title="MrLogaLoga (module)">MrLogaLoga</a></span></span>
41
+ &raquo;
42
+ <span class="title">Configuration</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Class: MrLogaLoga::Configuration
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName">Object</span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next">MrLogaLoga::Configuration</li>
78
+
79
+ </ul>
80
+ <a href="#" class="inheritanceTree">show all</a>
81
+
82
+ </dd>
83
+ </dl>
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+ <dl>
96
+ <dt>Defined in:</dt>
97
+ <dd>lib/mr_loga_loga/configuration.rb</dd>
98
+ </dl>
99
+
100
+ </div>
101
+
102
+ <h2>Overview</h2><div class="docstring">
103
+ <div class="discussion">
104
+
105
+ <h2 id="label-Description">Description</h2>
106
+
107
+ <p>The configuration class for MrLogaLoga</p>
108
+
109
+ <h2 id="label-Usage">Usage</h2>
110
+
111
+ <pre class="code ruby"><code class="ruby">MrLogaLoga.configure do |configuration|
112
+ configuration.logger = ...
113
+ end
114
+ </code></pre>
115
+
116
+
117
+ </div>
118
+ </div>
119
+ <div class="tags">
120
+
121
+
122
+ </div>
123
+
124
+
125
+
126
+ <h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
127
+ <ul class="summary">
128
+
129
+ <li class="public ">
130
+ <span class="summary_signature">
131
+
132
+ <a href="#logger-instance_method" title="#logger (instance method)">#<strong>logger</strong> &#x21d2; Object </a>
133
+
134
+
135
+
136
+ </span>
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+
147
+
148
+
149
+ <span class="summary_desc"><div class='inline'>
150
+ <p>Returns the value of attribute logger.</p>
151
+ </div></span>
152
+
153
+ </li>
154
+
155
+
156
+ </ul>
157
+
158
+
159
+
160
+
161
+
162
+ <h2>
163
+ Instance Method Summary
164
+ <small><a href="#" class="summary_toggle">collapse</a></small>
165
+ </h2>
166
+
167
+ <ul class="summary">
168
+
169
+ <li class="public ">
170
+ <span class="summary_signature">
171
+
172
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(**kwargs) &#x21d2; Configuration </a>
173
+
174
+
175
+
176
+ </span>
177
+
178
+
179
+ <span class="note title constructor">constructor</span>
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+ <span class="summary_desc"><div class='inline'>
189
+ <p>Initialize the configuration by setting configuration default values.</p>
190
+ </div></span>
191
+
192
+ </li>
193
+
194
+
195
+ <li class="public ">
196
+ <span class="summary_signature">
197
+
198
+ <a href="#reset-instance_method" title="#reset (instance method)">#<strong>reset</strong> &#x21d2; Object </a>
199
+
200
+
201
+
202
+ </span>
203
+
204
+
205
+
206
+
207
+
208
+
209
+
210
+
211
+
212
+ <span class="summary_desc"><div class='inline'>
213
+ <p>Reset the configuration to default values.</p>
214
+ </div></span>
215
+
216
+ </li>
217
+
218
+
219
+ </ul>
220
+
221
+
222
+ <div id="constructor_details" class="method_details_list">
223
+ <h2>Constructor Details</h2>
224
+
225
+ <div class="method_details first">
226
+ <h3 class="signature first" id="initialize-instance_method">
227
+
228
+ #<strong>initialize</strong>(**kwargs) &#x21d2; <tt><span class='object_link'><a href="" title="MrLogaLoga::Configuration (class)">Configuration</a></span></tt>
229
+
230
+
231
+
232
+
233
+
234
+ </h3><div class="docstring">
235
+ <div class="discussion">
236
+
237
+ <p>Initialize the configuration by setting configuration default values</p>
238
+
239
+
240
+ </div>
241
+ </div>
242
+ <div class="tags">
243
+
244
+
245
+ </div><table class="source_code">
246
+ <tr>
247
+ <td>
248
+ <pre class="lines">
249
+
250
+
251
+ 17
252
+ 18
253
+ 19
254
+ 20</pre>
255
+ </td>
256
+ <td>
257
+ <pre class="code"><span class="info file"># File 'lib/mr_loga_loga/configuration.rb', line 17</span>
258
+
259
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='op'>**</span><span class='id identifier rubyid_kwargs'>kwargs</span><span class='rparen'>)</span>
260
+ <span class='id identifier rubyid_reset'>reset</span>
261
+ <span class='id identifier rubyid_kwargs'>kwargs</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>|</span> <span class='id identifier rubyid_instance_variable_set'>instance_variable_set</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>@</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_key'>key</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
262
+ <span class='kw'>end</span></pre>
263
+ </td>
264
+ </tr>
265
+ </table>
266
+ </div>
267
+
268
+ </div>
269
+
270
+ <div id="instance_attr_details" class="attr_details">
271
+ <h2>Instance Attribute Details</h2>
272
+
273
+
274
+ <span id="logger=-instance_method"></span>
275
+ <div class="method_details first">
276
+ <h3 class="signature first" id="logger-instance_method">
277
+
278
+ #<strong>logger</strong> &#x21d2; <tt>Object</tt>
279
+
280
+
281
+
282
+
283
+
284
+ </h3><div class="docstring">
285
+ <div class="discussion">
286
+
287
+ <p>Returns the value of attribute logger.</p>
288
+
289
+
290
+ </div>
291
+ </div>
292
+ <div class="tags">
293
+
294
+
295
+ </div><table class="source_code">
296
+ <tr>
297
+ <td>
298
+ <pre class="lines">
299
+
300
+
301
+ 14
302
+ 15
303
+ 16</pre>
304
+ </td>
305
+ <td>
306
+ <pre class="code"><span class="info file"># File 'lib/mr_loga_loga/configuration.rb', line 14</span>
307
+
308
+ <span class='kw'>def</span> <span class='id identifier rubyid_logger'>logger</span>
309
+ <span class='ivar'>@logger</span>
310
+ <span class='kw'>end</span></pre>
311
+ </td>
312
+ </tr>
313
+ </table>
314
+ </div>
315
+
316
+ </div>
317
+
318
+
319
+ <div id="instance_method_details" class="method_details_list">
320
+ <h2>Instance Method Details</h2>
321
+
322
+
323
+ <div class="method_details first">
324
+ <h3 class="signature first" id="reset-instance_method">
325
+
326
+ #<strong>reset</strong> &#x21d2; <tt>Object</tt>
327
+
328
+
329
+
330
+
331
+
332
+ </h3><div class="docstring">
333
+ <div class="discussion">
334
+
335
+ <p>Reset the configuration to default values</p>
336
+
337
+
338
+ </div>
339
+ </div>
340
+ <div class="tags">
341
+
342
+
343
+ </div><table class="source_code">
344
+ <tr>
345
+ <td>
346
+ <pre class="lines">
347
+
348
+
349
+ 23
350
+ 24
351
+ 25</pre>
352
+ </td>
353
+ <td>
354
+ <pre class="code"><span class="info file"># File 'lib/mr_loga_loga/configuration.rb', line 23</span>
355
+
356
+ <span class='kw'>def</span> <span class='id identifier rubyid_reset'>reset</span>
357
+ <span class='ivar'>@logger</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../MrLogaLoga.html" title="MrLogaLoga (module)">MrLogaLoga</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Logger.html" title="MrLogaLoga::Logger (class)">Logger</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Logger.html#initialize-instance_method" title="MrLogaLoga::Logger#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='gvar'>$stdout</span><span class='rparen'>)</span>
358
+ <span class='kw'>end</span></pre>
359
+ </td>
360
+ </tr>
361
+ </table>
362
+ </div>
363
+
364
+ </div>
365
+
366
+ </div>
367
+
368
+ <div id="footer">
369
+ Generated on Wed Jan 5 09:59:09 2022 by
370
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
371
+ 0.9.27 (ruby-3.0.0).
372
+ </div>
373
+
374
+ </div>
375
+ </body>
376
+ </html>