dclog 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 88d74c9cb4f813bbbaf6bc21a4660ba57caad8d939ac7ebe3a64f4e835cca4f5
4
- data.tar.gz: 44e8891eb48fe920874afc2c6341992563b34346d4d37cf93c45e410064b860c
3
+ metadata.gz: ee9d53ab78011fdc8e755825e2fbdb43204800c765686a2fdb9d5c6744065b53
4
+ data.tar.gz: e85ae2c88f45b46c56fbe104db22790e2aa33a5b50dde9118eed86077398c8b5
5
5
  SHA512:
6
- metadata.gz: 8673b89dbd6fdfa2fbed0b407ce65ad7ee6dc631b0ce353d0c5bb7d668d25d45787cd6d26f6f6948454df11e870910444ac33a7fff32ab7dc48085e98a7e3252
7
- data.tar.gz: 4613e353a4e9b48dbbec8e00dacbc3d600765f4b803fe57cf56eafcd98a4cb215b12fabfc7be10c5d83338b697a5dfb5bdcf7addd56c17aa91c6acc4c364c728
6
+ metadata.gz: 989fde408ff44bd9c86658dae311434fc2a0ab381452058dc7947ce16b32b967865f459c3ae8277d2021b47e94dab235c442cc5f10cda74ac66013edefce76f4
7
+ data.tar.gz: e474783df280fe5375bc1025b8d3a63f0be0259fbbd7150a0dd1c8bdd4c9d6a138dc0798da8349e58e0124b93be2fd973554633efc70e37efeeaa06b92e83961
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,92 @@
1
+ # Contributing
2
+
3
+ When contributing to this repository, please first discuss the change you wish to make via issue,
4
+ email, or any other method with the owners of this repository before making a change.
5
+
6
+ Please note we have a code of conduct, please follow it in all your interactions with the project.
7
+
8
+ ## Pull Request Process
9
+
10
+ 1. Ensure any install or build dependencies are removed before the end of the layer when doing a
11
+ build.
12
+ 2. Update the README.md with details of changes to the interface, this includes new environment
13
+ variables, exposed ports, useful file locations and container parameters.
14
+ 3. Increase the version numbers in any examples files and the README.md to the new version that this
15
+ Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/).
16
+ 4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you
17
+ do not have permission to do that, you may request the second reviewer to merge it for you.
18
+
19
+ ## Code of Conduct
20
+
21
+ ### Our Pledge
22
+
23
+ In the interest of fostering an open and welcoming environment, we as
24
+ contributors and maintainers pledge to making participation in our project and
25
+ our community a harassment-free experience for everyone, regardless of age, body
26
+ size, disability, ethnicity, gender identity and expression, level of experience,
27
+ nationality, personal appearance, race, religion, or sexual identity and
28
+ orientation.
29
+
30
+ ### Our Standards
31
+
32
+ Examples of behavior that contributes to creating a positive environment
33
+ include:
34
+
35
+ * Using welcoming and inclusive language
36
+ * Being respectful of differing viewpoints and experiences
37
+ * Gracefully accepting constructive criticism
38
+ * Focusing on what is best for the community
39
+ * Showing empathy towards other community members
40
+
41
+ Examples of unacceptable behavior by participants include:
42
+
43
+ * The use of sexualized language or imagery and unwelcome sexual attention or
44
+ advances
45
+ * Trolling, insulting/derogatory comments, and personal or political attacks
46
+ * Public or private harassment
47
+ * Publishing others' private information, such as a physical or electronic
48
+ address, without explicit permission
49
+ * Other conduct which could reasonably be considered inappropriate in a
50
+ professional setting
51
+
52
+ ### Our Responsibilities
53
+
54
+ Project maintainers are responsible for clarifying the standards of acceptable
55
+ behavior and are expected to take appropriate and fair corrective action in
56
+ response to any instances of unacceptable behavior.
57
+
58
+ Project maintainers have the right and responsibility to remove, edit, or
59
+ reject comments, commits, code, wiki edits, issues, and other contributions
60
+ that are not aligned to this Code of Conduct, or to ban temporarily or
61
+ permanently any contributor for other behaviors that they deem inappropriate,
62
+ threatening, offensive, or harmful.
63
+
64
+ ### Scope
65
+
66
+ This Code of Conduct applies both within project spaces and in public spaces
67
+ when an individual is representing the project or its community. Examples of
68
+ representing a project or community include using an official project e-mail
69
+ address, posting via an official social media account, or acting as an appointed
70
+ representative at an online or offline event. Representation of a project may be
71
+ further defined and clarified by project maintainers.
72
+
73
+ ### Enforcement
74
+
75
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
76
+ reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
77
+ complaints will be reviewed and investigated and will result in a response that
78
+ is deemed necessary and appropriate to the circumstances. The project team is
79
+ obligated to maintain confidentiality with regard to the reporter of an incident.
80
+ Further details of specific enforcement policies may be posted separately.
81
+
82
+ Project maintainers who do not follow or enforce the Code of Conduct in good
83
+ faith may face temporary or permanent repercussions as determined by other
84
+ members of the project's leadership.
85
+
86
+ ### Attribution
87
+
88
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
89
+ available at [http://contributor-covenant.org/version/1/4][version]
90
+
91
+ [homepage]: http://contributor-covenant.org
92
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dclog (0.2.2)
4
+ dclog (0.2.3)
5
5
  rails (>= 5.0.0)
6
6
 
7
7
  GEM
@@ -88,7 +88,7 @@ GEM
88
88
  mini_portile2 (2.6.1)
89
89
  minitest (5.14.4)
90
90
  nio4r (2.5.8)
91
- nokogiri (1.12.4)
91
+ nokogiri (1.12.5)
92
92
  mini_portile2 (~> 2.6.1)
93
93
  racc (~> 1.4)
94
94
  parallel (1.20.1)
data/README.md CHANGED
@@ -30,11 +30,16 @@ Rails.application.configure do
30
30
 
31
31
  logger = ActiveSupport::Logger.new($stdout)
32
32
  logger.formatter = proc do |severity, datetime, progname, message|
33
+ msg_regex = message.match(Dclog::LOG_REGEX)
34
+ request_id = msg_regex.nil? ? nil : msg_regex[1]
35
+ msg = msg_regex.nil? ? message : msg_regex[2]
36
+
33
37
  "#{JSON.dump(
34
38
  severity: severity,
35
39
  date: datetime.strftime('%Y-%m-%d %H:%M:%S'),
36
40
  caller: progname,
37
- message: message
41
+ request_id: request_id,
42
+ message: msg
38
43
  )}\n"
39
44
  end
40
45
  config.logger = ActiveSupport::TaggedLogging.new(logger)
data/lib/dclog/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dclog
4
- VERSION = '0.2.2'
4
+ VERSION = '0.2.3'
5
5
  end
data/lib/dclog.rb CHANGED
@@ -10,6 +10,8 @@ rescue LoadError
10
10
  end
11
11
 
12
12
  module Dclog
13
+ LOG_REGEX = /^\[([a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12})\]\s+(.+)$/.freeze
14
+
13
15
  class << self
14
16
  def method_missing(method, *args)
15
17
  caller = caller_locations.first.label
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dclog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jairo Junior
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2021-09-24 00:00:00.000000000 Z
13
+ date: 2021-10-05 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec
@@ -82,6 +82,7 @@ files:
82
82
  - ".gitignore"
83
83
  - ".rspec"
84
84
  - ".rubocop.yml"
85
+ - CONTRIBUTING.md
85
86
  - Gemfile
86
87
  - Gemfile.lock
87
88
  - LICENSE.txt
@@ -114,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
114
115
  - !ruby/object:Gem::Version
115
116
  version: '0'
116
117
  requirements: []
117
- rubygems_version: 3.1.4
118
+ rubygems_version: 3.1.2
118
119
  signing_key:
119
120
  specification_version: 4
120
121
  summary: A logger