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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fc07fd046be4d08dd0bf3e972ab83f5db6468186ca7d41c2ec868dd698f308d7
4
- data.tar.gz: 850be7ee87e9e30fd203236d274755d02c75976ec8a1e467a94c83c50fd9894c
3
+ metadata.gz: e5b2363b82656e3c48f6d43a0852494f65ec87a5c6844ea4227dd99fb077ff07
4
+ data.tar.gz: 498615dc6cec442558b51135b9764ae1a58f51e551c7e5d58bcd34690bb0156d
5
5
  SHA512:
6
- metadata.gz: 322027d12c0e96b227d67e0c60cca022c65945da4477fd8f7dfac8749dd194111db11cd5a8ca09e44334807ab949b510bf8b169ea0258ba1472a854d7bb5d00c
7
- data.tar.gz: c79b0c42deadf14c4119ab6084151977c0e31f829ce9d3323cdf92502d9a79f9977cbfe4ed944cded842c6f2b48825774afce8390cce1ef40589e49423aa7631
6
+ metadata.gz: e51b201b0a445c8b35e681ca7527fb4dd93d36b31a866a06d419dd54472a09ed90441bc8209b10c49640fe3725394e61cfc737afa94dc17bad953a06acc1e48e
7
+ data.tar.gz: 94fc04f858499978f8853bc650ef0a1e0ec3cfe8f83972fc21610e5dbc53f4b8e934c5252b10260d1ca6c81e693b9c26c3ada01eb69b03ffd99cb4f60c2f84d9
@@ -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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- chili_logger (0.1.3)
4
+ chili_logger (0.1.4)
5
5
  aws-sdk-secretsmanager (~> 1.36.0)
6
6
  aws-sdk-sqs (~> 1.30.0)
7
7
  bunny
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] = versions.last.changeset if versions.last #if you are using paper_trail
979
+ record_hash[:last_changes] = saved_changes
982
980
  record_hash[:errors] = errors
983
981
 
984
982
  record_hash
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
3
 
4
4
  RSpec::Core::RakeTask.new(:spec)
5
5
 
6
- task :default => :spec
6
+ task default: :spec
@@ -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 ||= {}
@@ -1,3 +1,3 @@
1
1
  class ChiliLogger
2
- VERSION = '0.1.3'.freeze
2
+ VERSION = '0.1.4'.freeze
3
3
  end
@@ -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
@@ -22,7 +22,7 @@ class ChiliLogger
22
22
  end
23
23
  # only overwrite if :errors was explicitly set in main_content
24
24
  uniformized_content[:errors] = errors(content[:errors]) if content.key?(:errors)
25
-
25
+
26
26
  uniformized_content
27
27
  end
28
28
 
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.3
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-04 00:00:00.000000000 Z
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