google_logger 1.1.0 → 1.1.2
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/lib/google_logger/params_replacer.rb +3 -1
- data/lib/google_logger/version.rb +1 -1
- data/lib/google_logger.rb +12 -5
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0854a9725abc6767f415b602471c8d274633f85a8a05a3d33905fd48471d7d01'
|
4
|
+
data.tar.gz: e5c61eb39cc7c29cf1f6137d7c9de8c1c24dbf2438a07d12650b73cc2a275c86
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c38e64fe55ce1b0750eb09178145ab1dae718ef2056408dfbdc6f7e469a302911e072c0a302b28e677f12590ce7f9f2ae5c1be0d878a47eba7297b0ee2e1982
|
7
|
+
data.tar.gz: 7301212837685195f2c2e79e29b9f54928a0790a628c9f5784981a3ac886fc9ed04a1448e2b216c134767f607feb723b612c0bf4ca441ed3efe80bb53a163279
|
data/lib/google_logger.rb
CHANGED
@@ -92,11 +92,7 @@ module GoogleLogger
|
|
92
92
|
#
|
93
93
|
# @return [Object] GoogleLogger::Logger by default, local logger if `loc_locally` is set to true
|
94
94
|
def logger
|
95
|
-
|
96
|
-
Loggers::LocalLogger.new
|
97
|
-
else
|
98
|
-
Loggers::CloudLogger.new
|
99
|
-
end
|
95
|
+
configuration.log_locally ? local_logger : cloud_logger
|
100
96
|
end
|
101
97
|
|
102
98
|
# Log gem errors locally if local_logger is present
|
@@ -107,8 +103,19 @@ module GoogleLogger
|
|
107
103
|
local_logger.error "GOOGLE_LOGGER ERROR: #{exception.inspect}" if local_logger.present?
|
108
104
|
end
|
109
105
|
|
106
|
+
# mask secret param values
|
110
107
|
def deep_replace_secret_params(params)
|
111
108
|
ParamsReplacer.deep_replace_secret_params(params)
|
112
109
|
end
|
110
|
+
|
111
|
+
# get a cached instance of a local logger
|
112
|
+
def local_logger
|
113
|
+
@local_logger ||= Loggers::LocalLogger.new
|
114
|
+
end
|
115
|
+
|
116
|
+
# get a cached instance of a cloud logger
|
117
|
+
def cloud_logger
|
118
|
+
@cloud_logger ||= Loggers::CloudLogger.new
|
119
|
+
end
|
113
120
|
end
|
114
121
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google_logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Hric
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-04-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -78,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
78
|
- !ruby/object:Gem::Version
|
79
79
|
version: '0'
|
80
80
|
requirements: []
|
81
|
-
rubygems_version: 3.
|
81
|
+
rubygems_version: 3.1.2
|
82
82
|
signing_key:
|
83
83
|
specification_version: 4
|
84
84
|
summary: Provides a simple interface to write logs to the google cloud platform.
|