chili_logger 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +9 -0
- data/Gemfile.lock +1 -1
- data/README.md +1 -3
- data/Rakefile +3 -3
- data/lib/brokers/main_broker.rb +2 -0
- data/lib/chili_logger/version.rb +1 -1
- data/lib/errors/logging_error_handler/logging_error_handler.rb +2 -0
- data/lib/helpers/values/default.rb +1 -1
- data/lib/helpers/values/type_uniformizer/main_content.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5b2363b82656e3c48f6d43a0852494f65ec87a5c6844ea4227dd99fb077ff07
|
4
|
+
data.tar.gz: 498615dc6cec442558b51135b9764ae1a58f51e551c7e5d58bcd34690bb0156d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e51b201b0a445c8b35e681ca7527fb4dd93d36b31a866a06d419dd54472a09ed90441bc8209b10c49640fe3725394e61cfc737afa94dc17bad953a06acc1e48e
|
7
|
+
data.tar.gz: 94fc04f858499978f8853bc650ef0a1e0ec3cfe8f83972fc21610e5dbc53f4b8e934c5252b10260d1ca6c81e693b9c26c3ada01eb69b03ffd99cb4f60c2f84d9
|
data/.rubocop.yml
CHANGED
@@ -1,5 +1,12 @@
|
|
1
|
+
|
1
2
|
AllCops:
|
2
3
|
TargetRubyVersion: 2.3.3
|
4
|
+
Exclude:
|
5
|
+
- spec/**/**.rb
|
6
|
+
- Gemfile
|
7
|
+
- chili_logger.gemspec
|
8
|
+
- local_tests_cheatsheet.rb
|
9
|
+
- bin/**/*
|
3
10
|
Metrics/LineLength:
|
4
11
|
Max: 120
|
5
12
|
Metrics/BlockLength:
|
@@ -8,3 +15,5 @@ Metrics/ModuleLength:
|
|
8
15
|
Max: 180
|
9
16
|
Style/FrozenStringLiteralComment:
|
10
17
|
Enabled: false
|
18
|
+
Style/DateTime:
|
19
|
+
Enabled: false
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -963,8 +963,6 @@ class ApplicationRecord < ActiveRecord::Base
|
|
963
963
|
after_update -> { add_modified_record_to_log('update') }, on: :update
|
964
964
|
before_destroy -> { add_modified_record_to_log('destroy') }, on: :destroy
|
965
965
|
|
966
|
-
has_paper_trail # if you are using paper_trail
|
967
|
-
|
968
966
|
# enriches logs by automatically adding modified_records to them
|
969
967
|
def add_modified_record_to_log(action_verb, modified_record = self)
|
970
968
|
# only adds to log if record was created, changed or destroyed
|
@@ -978,7 +976,7 @@ class ApplicationRecord < ActiveRecord::Base
|
|
978
976
|
# ChiliLogger requires modified_records to be hashes.
|
979
977
|
# This method converts ActiveRecords instances to hashes and adds some extra useful data
|
980
978
|
def to_denormalized_hash(record_hash = as_json)
|
981
|
-
record_hash[:last_changes] =
|
979
|
+
record_hash[:last_changes] = saved_changes
|
982
980
|
record_hash[:errors] = errors
|
983
981
|
|
984
982
|
record_hash
|
data/Rakefile
CHANGED
data/lib/brokers/main_broker.rb
CHANGED
@@ -6,6 +6,8 @@ class ChiliLogger
|
|
6
6
|
# class that configures and manages all supported brokers
|
7
7
|
class MainBroker
|
8
8
|
def initialize(broker_name, broker_config, logging_error_handler)
|
9
|
+
return if ChiliLogger.instance.deactivated
|
10
|
+
|
9
11
|
@default = ChiliLogger::Values::Default.new
|
10
12
|
@logging_error_handler = logging_error_handler
|
11
13
|
broker_config ||= {}
|
data/lib/chili_logger/version.rb
CHANGED
@@ -6,6 +6,8 @@ class ChiliLogger
|
|
6
6
|
# class that handles errors when message broker can't be reached, etc...
|
7
7
|
class LoggingErrorHandler
|
8
8
|
def initialize(fallback_name = nil, config = {})
|
9
|
+
return if ChiliLogger.instance.deactivated
|
10
|
+
|
9
11
|
@default = ChiliLogger::Values::Default.new
|
10
12
|
config ||= {}
|
11
13
|
validate_config(config)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# class for centralizing Creative's logging logic
|
2
2
|
class ChiliLogger
|
3
|
-
# module responsible for uniformization of values in ChiliLogger
|
3
|
+
# module responsible for uniformization of values in ChiliLogger
|
4
4
|
module Values
|
5
5
|
# class for keeping all default values in a single place
|
6
6
|
class Default
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chili_logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- lucas sandeville
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-08-
|
11
|
+
date: 2020-08-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-sqs
|