insights-loggers-ruby 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/insights/loggers/factory.rb +16 -2
- data/lib/insights/loggers/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c0a7bf4aa40c070010cc494461deb0f35923c2c274e546577dfaafa9edca8a3
|
4
|
+
data.tar.gz: 0c9e52139fb119a3f740e033987a9400444d44660fe375a343361b375b3d365b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e75c88eee30d67841685021d4a5234b6b6f7d15c156516d63852a86a3eb163dbf1fe039e37eecdf8f87255e2f2419895bc8d04cf4907438867e85909079748c
|
7
|
+
data.tar.gz: ed7ecdfa87390b45fef75d396249c6a2ad7a76d772e3926ac1c98ec7f34fb3a456f88d5a3d2b3c25a1ae1d174d88c7efa3db93301a4285d2c808c956805785a4
|
@@ -2,7 +2,7 @@ module Insights
|
|
2
2
|
module Loggers
|
3
3
|
class Factory
|
4
4
|
def self.create_logger(logger_class, args = nil)
|
5
|
-
logger_library_loader(logger_class)
|
5
|
+
logger_library_loader(logger_class, args)
|
6
6
|
klass = logger_class.safe_constantize
|
7
7
|
|
8
8
|
if klass
|
@@ -23,10 +23,18 @@ module Insights
|
|
23
23
|
logger.app_name_for_formatter(args[:app_name])
|
24
24
|
end
|
25
25
|
|
26
|
+
if args && args[:extend_module]
|
27
|
+
logger.extend(args[:extend_module].safe_constantize)
|
28
|
+
end
|
29
|
+
|
26
30
|
logger
|
27
31
|
end
|
28
32
|
|
29
|
-
|
33
|
+
EXTENDED_LIBRARY_FROM_MODULE = {
|
34
|
+
"TopologicalInventory::Providers::Common::LoggingFunctions" => "topological_inventory/providers/common/logging"
|
35
|
+
}.freeze
|
36
|
+
|
37
|
+
private_class_method def self.logger_library_loader(logger_class, args = nil)
|
30
38
|
case logger_class
|
31
39
|
when "ManageIQ::Loggers::Base"
|
32
40
|
require "manageiq/loggers/base"
|
@@ -48,6 +56,12 @@ module Insights
|
|
48
56
|
require "manageiq/loggers/base"
|
49
57
|
require "manageiq/loggers/container"
|
50
58
|
require "insights/loggers/std_error_logger"
|
59
|
+
if args && args[:extend_module]
|
60
|
+
library_path = EXTENDED_LIBRARY_FROM_MODULE[args[:extend_module]]
|
61
|
+
raise ArgumentError, "Unable to find library for #{args[:extend_module]}" unless library_path
|
62
|
+
|
63
|
+
require EXTENDED_LIBRARY_FROM_MODULE[args[:extend_module]]
|
64
|
+
end
|
51
65
|
when "TopologicalInventory::Providers::Common::Logger"
|
52
66
|
require "topological_inventory/providers/common/logging"
|
53
67
|
else
|