effective_logging 3.1.7 → 3.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/datatables/effective_logs_datatable.rb +1 -1
- data/lib/effective_logging/active_storage_logger.rb +2 -0
- data/lib/effective_logging/email_logger.rb +5 -5
- data/lib/effective_logging/log_page_views.rb +1 -1
- data/lib/effective_logging/version.rb +1 -1
- data/lib/effective_logging.rb +5 -2
- 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: 793f67a081ade00db602453e788de2c7449ddefe2dc3884aa3d2c72046170cdb
|
4
|
+
data.tar.gz: '08531a7570a1258c5709d177fbe7ca3a35448121d4b0bef24da63feba868a35c'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ccc8e31fb99180d15e8ff5de19443ab8c1a4097650f90de6c4555c2776bb47fa4b0f24e6c2c9224d860c32c9b5250f3bcb13abcd01ffb050c4603c7ae30620ba
|
7
|
+
data.tar.gz: 3ea1c48c81d890b7134b25af34667bb54311e30a04e5737bc4331cd9879d03b76dc993bcbbfdeaf35bcf566b9c8849ad8a8293dcc7553f13fa4ebcb23d027ba3
|
@@ -28,7 +28,7 @@ module EffectiveLogging
|
|
28
28
|
|
29
29
|
# Pass a tenant to your mailer
|
30
30
|
# mail(to: 'admin@example.com', subject: @post.title, tenant: Tenant.current)
|
31
|
-
tenant = if message.header['tenant'].present?
|
31
|
+
tenant = if message.header['tenant'].present?
|
32
32
|
value = message.header['tenant'].to_s.to_sym # OptionalField, not a String here
|
33
33
|
message.header['tenant'] = nil
|
34
34
|
value
|
@@ -36,13 +36,13 @@ module EffectiveLogging
|
|
36
36
|
|
37
37
|
user_klass = "#{tenant.to_s.classify}::User".safe_constantize
|
38
38
|
|
39
|
-
|
40
|
-
body
|
39
|
+
parts = (message.body.try(:parts) || []).map { |part| [part, (part.parts if part.respond_to?(:parts))] }.flatten
|
40
|
+
body = parts.find { |part| part.content_type.to_s.downcase.include?('text/html') } || message.body
|
41
41
|
|
42
42
|
fields[:email] = "#{message.header}<hr>#{body}"
|
43
43
|
|
44
|
-
if tenant.present?
|
45
|
-
Tenant.
|
44
|
+
if tenant.present? && defined?(Tenant)
|
45
|
+
Tenant.as_if(tenant) { log_email(message, fields, user_klass) }
|
46
46
|
else
|
47
47
|
log_email(message, fields, user_klass)
|
48
48
|
end
|
@@ -37,7 +37,7 @@ module EffectiveLogging
|
|
37
37
|
def effective_logging_log_page_view
|
38
38
|
return if EffectiveLogging.supressed?
|
39
39
|
return if @_effective_logging_skip_log_page_view == true
|
40
|
-
return if (self.class.log_page_views_opts[:skip_namespace] || []).include?(self.class.
|
40
|
+
return if (self.class.log_page_views_opts[:skip_namespace] || []).include?(self.class.ancestors.first)
|
41
41
|
|
42
42
|
user = EffectiveLogging.current_user || (current_user if respond_to?(:current_user))
|
43
43
|
|
data/lib/effective_logging.rb
CHANGED
@@ -3,8 +3,6 @@ require 'effective_logging/engine'
|
|
3
3
|
require 'effective_logging/version'
|
4
4
|
|
5
5
|
module EffectiveLogging
|
6
|
-
mattr_accessor :supressed
|
7
|
-
|
8
6
|
def self.config_keys
|
9
7
|
[
|
10
8
|
:logs_table_name, :layout, :additional_statuses,
|
@@ -47,6 +45,11 @@ module EffectiveLogging
|
|
47
45
|
Thread.current[:effective_logging_current_user]
|
48
46
|
end
|
49
47
|
|
48
|
+
# Used to supress all logging
|
49
|
+
def self.supressed=(value)
|
50
|
+
Thread.current[:effective_logging_supressed] = value
|
51
|
+
end
|
52
|
+
|
50
53
|
def self.supressed(&block)
|
51
54
|
Thread.current[:effective_logging_supressed] = true
|
52
55
|
yield
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_logging
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|