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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5d20b60ac3a89c2e8e3391cce7a1eeb83ad0fdaacbd47248161dd32bc59d32ec
4
- data.tar.gz: ba228ea8e5ba35307ddf029dc1dd4d87b712c9c1532b817ea36ff5d94132170a
3
+ metadata.gz: 1c0a7bf4aa40c070010cc494461deb0f35923c2c274e546577dfaafa9edca8a3
4
+ data.tar.gz: 0c9e52139fb119a3f740e033987a9400444d44660fe375a343361b375b3d365b
5
5
  SHA512:
6
- metadata.gz: 8d1f19d745517bdb83ff594d0014719dcc6e054a7af7ae4c6f064171e69e08374905b40c6f7172c5af2ddc34d02381aa316fb0c97b7ba1c5d6302ce28336e350
7
- data.tar.gz: f05373b64e491f6560026b258e948f516937970415fb6c17aace394d5104e0f74ed3b3159d92042bedb656f310135853b1b502a57b71d1a75bb1cf12117ea965
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
- private_class_method def self.logger_library_loader(logger_class)
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
@@ -1,5 +1,5 @@
1
1
  module Insights
2
2
  module Loggers
3
- VERSION = "0.1.7".freeze
3
+ VERSION = "0.1.8".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: insights-loggers-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Insights Authors