log_method 1.0.0.pre.beta1 → 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 +4 -4
- data/README.md +8 -12
- data/lib/log_method/version.rb +1 -1
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aaf9e766e7cd25359757ba13ccb52a0f21452c835025dde17e58a2ec1591c311
|
4
|
+
data.tar.gz: ec61724f38c1f35ce76747cd5f3b9f21c0f775b76e4bfd43bcf76d8cf01c9318
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6d1a643280ce11e2502d364da9d15c1f9032eb0b7ed81f8c70cc2431fe1113a9a8c05447e1590e308271705ea3db5a5d847982281e4e9a6c99caae06a3abe73
|
7
|
+
data.tar.gz: cca740859bfed322dc5762b7190b743bdcff095f12d82a9541c9e27544243a4c90295b5d16f5f0116cf68d09dd17a3e393a25c530240329b54cc9c2c020d9769
|
data/README.md
CHANGED
@@ -36,24 +36,20 @@ class SomeClass
|
|
36
36
|
end
|
37
37
|
```
|
38
38
|
|
39
|
-
Assuming you have configured trace ids and current user id (see below for how), this is what your log message will look like (assuming the id of `some_active_record` is
|
39
|
+
Assuming you have configured trace ids and current user id (see below for how), this is what your log message will look like (assuming the id of `current_user` is 42 and that `some_active_record` is a `Widget` with id 7889):
|
40
40
|
|
41
41
|
```
|
42
|
-
[SomeClass#some_method](via LogMethod::Log) trace_id:7efa5401-08d8-44e3-b101-d5806563a3da current_user_id:42 [
|
42
|
+
[SomeClass#some_method](via LogMethod::Log) trace_id:7efa5401-08d8-44e3-b101-d5806563a3da current_user_id:42 [Widget:7889]: Beginnging the operation
|
43
43
|
```
|
44
44
|
|
45
45
|
Let's break down each part and understand why it's there, which will help you understand why you should use this gem:
|
46
46
|
|
47
|
-
* `[SomeClass#some_method]`
|
48
|
-
|
49
|
-
* `
|
50
|
-
|
51
|
-
* `
|
52
|
-
|
53
|
-
* `current_user_id:42` - System behavior often depends on who is logged in or who the "current actor" is. So you want this in your log.
|
54
|
-
* `[SomeActiveRecord:7889]:` - Almost always, code is operating on some object or operating in the context of some object. It's nice to know
|
55
|
-
exactly which one.
|
56
|
-
* `Beginnging the operation` - And, of course, your log message
|
47
|
+
* `[SomeClass#some_method]` - this gives the class and method where the log statement originated. Super helpful when looking at log output and trying to find what code generated that log message.
|
48
|
+
* `(via LogMethod::Log)` - This makes it clear that *this* gem produced this output. If you don't see this, it means something else is generating log output, too. Very handy for understanding the source of your log statements.
|
49
|
+
* `trace_id:7efa5401-08d8-44e3-b101-d5806563a3da` - If you set a trace id at the start of a web request, or when you queue a background job, you can then trace all log statements related to that request. SUPER handy for understanding what all happened in a given request you are looking at.
|
50
|
+
* `current_user_id:42` - System behavior often depends on who is logged in or who the "current actor" is. So you want this in your log.
|
51
|
+
* `[Widget:7889]:` - Code is almost always operating on some object or operating in the context of some object. It's nice to know exactly which one.
|
52
|
+
* `Beginnging the operation` - And, of course, your log message
|
57
53
|
|
58
54
|
### `log` method, explained
|
59
55
|
|
data/lib/log_method/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: log_method
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dave Copeland
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -38,7 +38,7 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
-
description:
|
41
|
+
description:
|
42
42
|
email:
|
43
43
|
- davec@naildrivin5.com
|
44
44
|
executables: []
|
@@ -73,7 +73,7 @@ metadata:
|
|
73
73
|
homepage_uri: https://github.com/sustainable-rails/log_method
|
74
74
|
source_code_uri: https://github.com/sustainable-rails/log_method
|
75
75
|
changelog_uri: https://github.com/sustainable-rails/log_method/releases
|
76
|
-
post_install_message:
|
76
|
+
post_install_message:
|
77
77
|
rdoc_options: []
|
78
78
|
require_paths:
|
79
79
|
- lib
|
@@ -84,12 +84,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
84
84
|
version: 2.5.0
|
85
85
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: '0'
|
90
90
|
requirements: []
|
91
|
-
rubygems_version: 3.
|
92
|
-
signing_key:
|
91
|
+
rubygems_version: 3.0.3
|
92
|
+
signing_key:
|
93
93
|
specification_version: 4
|
94
94
|
summary: A nice log method for your Rails app that provides a ton of useful context
|
95
95
|
in each message!
|