berkeley_library-logging 0.2.6.2 → 0.2.7
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 278ef46ccce64fab4aa75c6d93f7ed7cf12803588840f7010ee7728001957dd6
|
4
|
+
data.tar.gz: 8d0ffc097c007d160c0a655a7404652ee7d80afe142b54200fa813f457ed4c21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf627a3dfb63ef584e9a257db8f5a0268d66de51a87ba71815f95055d56cb5c4c4abcb437f1b4ac860b18e568e9b790617e93fc35b5aaf9858ed0ab9564c5597
|
7
|
+
data.tar.gz: 983f06d6e8fce525da56be1c1e661d6ee15ac348b751e9c86ecb95d180f187e9db5a95d823814cc7a93a116e8959a4c0978fdba94e8e152e7d449bb472e29c4c
|
data/CHANGES.md
CHANGED
@@ -8,13 +8,17 @@ module BerkeleyLibrary
|
|
8
8
|
class Configurator
|
9
9
|
class << self
|
10
10
|
|
11
|
+
# Applies the log configuration to the specified Rails config.
|
12
|
+
#
|
13
|
+
# @return [BerkeleyLibrary::Logging::Logger] the configured logger
|
11
14
|
def configure(config)
|
12
15
|
configure_lograge(config)
|
13
16
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
17
|
+
Loggers.new_default_logger(config).tap do |logger|
|
18
|
+
logger.info("Custom logger initialized for environment #{Logging.env.inspect}")
|
19
|
+
configure_webpacker(logger)
|
20
|
+
config.logger = logger
|
21
|
+
end
|
18
22
|
end
|
19
23
|
|
20
24
|
private
|
@@ -7,7 +7,7 @@ module BerkeleyLibrary
|
|
7
7
|
SUMMARY = 'Opinionated Ruby/Rails logging for UC Berkeley Library'.freeze
|
8
8
|
DESCRIPTION = 'A gem providing shared logging code for UC Berkeley Library gems and Rails applications'.freeze
|
9
9
|
LICENSE = 'MIT'.freeze
|
10
|
-
VERSION = '0.2.
|
10
|
+
VERSION = '0.2.7'.freeze
|
11
11
|
HOMEPAGE = 'https://github.com/BerkeleyLibrary/logging'.freeze
|
12
12
|
|
13
13
|
private_class_method :new
|
@@ -8,7 +8,8 @@ module BerkeleyLibrary
|
|
8
8
|
# Don't use the Railtie's own `config` because configure() needs
|
9
9
|
# Rails::Application::Configuration#default_log_file
|
10
10
|
initializer('logging.configure_berkeley_library_logging', before: :initialize_logger) do |app|
|
11
|
-
Configurator.configure(app.config)
|
11
|
+
logger = Configurator.configure(app.config)
|
12
|
+
BerkeleyLibrary::Logging.logger = logger
|
12
13
|
end
|
13
14
|
end
|
14
15
|
end
|
@@ -23,6 +23,11 @@ module BerkeleyLibrary
|
|
23
23
|
expect(config.logger).to be_a(Logging::Logger)
|
24
24
|
end
|
25
25
|
|
26
|
+
it 'returns the logger' do
|
27
|
+
logger = Configurator.configure(config)
|
28
|
+
expect(logger).to be(config.logger)
|
29
|
+
end
|
30
|
+
|
26
31
|
describe :configure_lograge! do
|
27
32
|
it 'enables Lograge' do
|
28
33
|
Configurator.configure(config)
|