onering-client 0.0.88 → 0.0.89
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.
- data/lib/onering.rb +1 -1
- data/lib/onering/cli/reporter.rb +4 -4
- data/lib/onering/plugins/reporter.rb +7 -2
- metadata +1 -1
data/lib/onering.rb
CHANGED
data/lib/onering/cli/reporter.rb
CHANGED
@@ -32,12 +32,12 @@ EOS
|
|
32
32
|
|
33
33
|
def self.run(args)
|
34
34
|
begin
|
35
|
-
Onering::Logger.debug("Gathering local data for report")
|
35
|
+
Onering::Logger.debug("Gathering local data for report", "Onering::CLI::Report")
|
36
36
|
report = Onering::Reporter.report().stringify_keys()
|
37
37
|
|
38
38
|
# pull report overrides from the config file
|
39
39
|
Onering::Config.get('reporter.fields',{}).each do |key, value|
|
40
|
-
Onering::Logger.debug("Override value #{key} from config file")
|
40
|
+
Onering::Logger.debug("Override value #{key} from config file", "Onering::CLI::Report")
|
41
41
|
|
42
42
|
if value.is_a?(Hash)
|
43
43
|
value.coalesce(key, nil, '.').each do |k,v|
|
@@ -53,7 +53,7 @@ EOS
|
|
53
53
|
# pull overrides from CLI arguments
|
54
54
|
@opts[:fields].each do |field|
|
55
55
|
key, value = field.split('=', 2)
|
56
|
-
Onering::Logger.debug("Override value #{key} from command line argument")
|
56
|
+
Onering::Logger.debug("Override value #{key} from command line argument", "Onering::CLI::Report")
|
57
57
|
|
58
58
|
value = nil if ['null', '', '-'].include?(value.to_s.strip.chomp)
|
59
59
|
report = report.set(key, value)
|
@@ -70,7 +70,7 @@ EOS
|
|
70
70
|
|
71
71
|
return report
|
72
72
|
rescue Timeout::Error
|
73
|
-
Onering::Logger.fatal!("Report took too long to generate, exiting...")
|
73
|
+
Onering::Logger.fatal!("Report took too long to generate, exiting...", "Onering::CLI::Report")
|
74
74
|
end
|
75
75
|
end
|
76
76
|
end
|
@@ -79,7 +79,7 @@ module Onering
|
|
79
79
|
Onering::Logger.debug("Loading plugin #{plugin}", "Onering::Reporter")
|
80
80
|
require "#{directory}/#{plugin}"
|
81
81
|
end
|
82
|
-
rescue Timeout::Error
|
82
|
+
rescue Timeout::Error
|
83
83
|
Onering::Logger.warn("Plugin #{plugin} took too long to return, skipping", "Onering::Reporter")
|
84
84
|
end
|
85
85
|
end
|
@@ -87,7 +87,12 @@ module Onering
|
|
87
87
|
end
|
88
88
|
end
|
89
89
|
rescue Exception => e
|
90
|
-
Onering::Logger.warn(e.message, e.class.name)
|
90
|
+
Onering::Logger.warn(e.message, "Onering::Reporter/#{e.class.name}")
|
91
|
+
|
92
|
+
e.backtrace.each do |eb|
|
93
|
+
Onering::Logger.debug(eb, "Onering::Reporter/#{e.class.name}")
|
94
|
+
end
|
95
|
+
|
91
96
|
next
|
92
97
|
end
|
93
98
|
end
|