chili_logger 0.0.10 → 0.0.11

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: 3c198e48264ec7a8ea5eb4a6c859ade33af7297a1c57880b4f0c5f729fbd18f9
4
- data.tar.gz: 3c8a2f0bca582eaaa234e5b894812e04b4b51788d3f35cf0e4da93064c6cb626
3
+ metadata.gz: d917b27026162b0d5c123b44dbdd9d3ae5ad6be1517785a8513967fbc9dad3ef
4
+ data.tar.gz: e9e7806e3ce5bc7e701aa1984d7f5bf5ece59392427a7a34496c6f20c9291127
5
5
  SHA512:
6
- metadata.gz: 6f3157a2903775e8ec640b066ea9b2c93593cf074ccda6ce5e8b77fd39f578002fc2c7c0aecc55481f94990c2710cdc1d3030ecb68938983d70a6569ce39c6b2
7
- data.tar.gz: 57f0fe673ba7e528114dca688e9da5ed855eaff94aa26e47f2fb89bed37c506b8b340becae60107278ff14f663fe94ff950e6e1e45992d4f9da5581c479c200b
6
+ metadata.gz: 2960caed15b4d69719bd351801a25b89e73e5c2874a2c17263a72baed7711073d01debaae85dcff517c4128e48646b9d3b479fe99515f741267a3db986fd59df
7
+ data.tar.gz: 0b8116d232569e56b148499663ea6993ef4bd222a835125a96e5b4407ea2a4137ffb0f3d15940824644c419f8a9e20625087572ecf57d261cb6efd09c86a1631
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- chili_logger (0.0.10)
4
+ chili_logger (0.0.11)
5
5
  aws-sdk (~> 2.9, >= 2.9.0)
6
6
  bunny
7
7
  httparty
data/README.md CHANGED
@@ -885,7 +885,8 @@ class ApplicationController < ActionController::Base
885
885
  def log_user
886
886
  return {} unless current_user
887
887
 
888
- multi_user_record = MultiUser::User.find(current_user&.cognito_id)
888
+ # use .where instead of .find, because .find raises error if no record is found
889
+ multi_user_record = MultiUser::User.where(external_id: current_user&.cognito_id).first
889
890
  log_user = {
890
891
  email: current_user&.email,
891
892
  cognito_id: multi_user_record&.id,
@@ -998,6 +999,10 @@ module Rake
998
999
  rescue StandardError => error
999
1000
  current_log = ChiliLogger.instance.current_log
1000
1001
 
1002
+ current_task = Rake.application.top_level_tasks.first
1003
+ current_log.update_service(current_task.split(':').first)
1004
+ current_log.update_action(current_task.split(':').last)
1005
+
1001
1006
  current_log.add_error(error.inspect)
1002
1007
  current_log.update_type('uncaught_error')
1003
1008
  current_log.publish
@@ -1017,14 +1022,14 @@ namespace :excel do
1017
1022
  task validation: :environment do
1018
1023
  loop do
1019
1024
  # start storing infos for validation log
1020
- transaction_desc = { log_type: 'transaction', service: 'excel', action: 'validation' }
1025
+ transaction_desc = { type: 'transaction', service: 'excel', action: 'validation' }
1021
1026
  log_user = { email: 'automated_task', cognito_id: 'automated_task'
1022
1027
  current_log = ChiliLogger.instance.start_new_log(desc: log_desc, user: log_user)
1023
1028
 
1024
1029
  usual task code...
1025
1030
 
1026
1031
  # only publish log if current log had modified_records added to it - so we don't clutter DB with meaningless logs
1027
- current_log.publish if current_log.modified_records
1032
+ current_log.publish unless current_log.modified_records.empty?
1028
1033
 
1029
1034
  sleep 5
1030
1035
  end
@@ -1041,7 +1046,7 @@ Unfortunately, due to the way most of our tasks are implemented - as infinite lo
1041
1046
  namespace :excel do
1042
1047
  task validation: :environment do
1043
1048
  loop do
1044
- heartbeat_desc = { log_type: 'monitoring', service: 'excel', action: 'validation' }
1049
+ heartbeat_desc = { type: 'monitoring', service: 'excel', action: 'validation' }
1045
1050
  log_user = { email: 'automated_task', cognito_id: 'automated_task'
1046
1051
  ChiliLogger.instance.publish_instant_log(desc: heartbeat_desc, user: log_user)
1047
1052
 
Binary file
@@ -1,3 +1,3 @@
1
1
  class ChiliLogger
2
- VERSION = "0.0.10"
2
+ VERSION = '0.0.11'
3
3
  end
@@ -3,7 +3,6 @@ require 'helpers/values/default'
3
3
  require 'helpers/values/type_uniformizer/desc'
4
4
  require 'helpers/values/type_uniformizer/main_content'
5
5
  require 'helpers/values/type_uniformizer/user'
6
- require 'byebug'
7
6
 
8
7
  # class for centralizing Creative's logging logic
9
8
  class ChiliLogger
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.0.10
4
+ version: 0.0.11
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-07-07 00:00:00.000000000 Z
11
+ date: 2020-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk
@@ -81,6 +81,7 @@ files:
81
81
  - assets/images/rabbit-topic-explanation.webp
82
82
  - bin/console
83
83
  - bin/setup
84
+ - chili_logger-0.0.10.gem
84
85
  - chili_logger-0.0.6.gem
85
86
  - chili_logger-0.0.7.gem
86
87
  - chili_logger-0.0.8.gem