mirror of
https://github.com/inspec/inspec
synced 2024-11-10 07:04:15 +00:00
Telemetry log messages improved for clarity of calls (#7104)
Signed-off-by: Nik08 <nikita.mathur@progress.com>
This commit is contained in:
parent
f34db91219
commit
e8ee11853b
2 changed files with 4 additions and 3 deletions
|
@ -23,6 +23,7 @@ module Inspec
|
|||
Inspec::Telemetry::RunContextProbe.under_automate? ||
|
||||
license&.license_type&.downcase == "commercial"
|
||||
|
||||
Inspec::Log.debug "Determined telemetry operation is not applicable and hence aborting it."
|
||||
return Inspec::Telemetry::Null
|
||||
end
|
||||
|
||||
|
@ -37,7 +38,7 @@ module Inspec
|
|||
end
|
||||
|
||||
def self.license
|
||||
Inspec::Log.debug "Fetching license context for telemetry"
|
||||
Inspec::Log.debug "Fetching license context for telemetry check"
|
||||
@license = ChefLicensing.license_context
|
||||
end
|
||||
|
||||
|
@ -45,7 +46,6 @@ module Inspec
|
|||
# These class methods make it convenient to call from anywhere within the InSpec codebase.
|
||||
######
|
||||
def self.run_starting(opts)
|
||||
Inspec::Log.debug "Initiating telemetry for InSpec"
|
||||
@@config ||= opts[:conf]
|
||||
instance.run_starting(opts)
|
||||
rescue StandardError => e
|
||||
|
@ -55,7 +55,6 @@ module Inspec
|
|||
def self.run_ending(opts)
|
||||
@@config ||= opts[:conf]
|
||||
instance.run_ending(opts)
|
||||
Inspec::Log.debug "Finishing telemetry for InSpec"
|
||||
rescue StandardError => e
|
||||
Inspec::Log.debug "Encountered error in Telemetry end run call -> #{e.message}"
|
||||
end
|
||||
|
|
|
@ -36,6 +36,7 @@ module Inspec
|
|||
end
|
||||
|
||||
def run_starting(_opts = {})
|
||||
Inspec::Log.debug "Initiating telemetry for InSpec"
|
||||
@scratch ||= {}
|
||||
@scratch[:features] ||= []
|
||||
@scratch[:run_start_time] = Time.now.getutc.iso8601
|
||||
|
@ -103,6 +104,7 @@ module Inspec
|
|||
end
|
||||
|
||||
Inspec::Log.debug "Final data for telemetry upload -> #{payload}"
|
||||
Inspec::Log.debug "Finishing telemetry for InSpec"
|
||||
# Return payload object for testing
|
||||
payload
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue