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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +9 -4
- data/chili_logger-0.0.10.gem +0 -0
- data/lib/chili_logger/version.rb +1 -1
- data/lib/current_log_accessor.rb +0 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d917b27026162b0d5c123b44dbdd9d3ae5ad6be1517785a8513967fbc9dad3ef
|
4
|
+
data.tar.gz: e9e7806e3ce5bc7e701aa1984d7f5bf5ece59392427a7a34496c6f20c9291127
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2960caed15b4d69719bd351801a25b89e73e5c2874a2c17263a72baed7711073d01debaae85dcff517c4128e48646b9d3b479fe99515f741267a3db986fd59df
|
7
|
+
data.tar.gz: 0b8116d232569e56b148499663ea6993ef4bd222a835125a96e5b4407ea2a4137ffb0f3d15940824644c419f8a9e20625087572ecf57d261cb6efd09c86a1631
|
data/Gemfile.lock
CHANGED
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
|
-
|
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 = {
|
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
|
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 = {
|
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
|
data/lib/chili_logger/version.rb
CHANGED
data/lib/current_log_accessor.rb
CHANGED
@@ -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.
|
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-
|
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
|