lib/contrast/api/decorators/message.rb in contrast-agent-4.8.0 vs lib/contrast/api/decorators/message.rb in contrast-agent-4.9.0

- old
+ new

@@ -1,19 +1,19 @@ # Copyright (c) 2021 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details. # frozen_string_literal: true require 'contrast/utils/object_share' require 'contrast/utils/string_utils' +require 'contrast/components/logger' module Contrast module Api module Decorators # Used to decorate the {Contrast::Api::Dtm::Message} protobuf model so it # can handle instance data massaging. module Message - include Contrast::Components::Interface - access_component :app_context, :logging + include Contrast::Components::Logger::InstanceMethods def self.included klass klass.extend(ClassMethods) end @@ -56,16 +56,16 @@ @@message_total += 1 # rubocop:disable Style/ClassVars end def build event msg = new - msg.app_name = APP_CONTEXT.app_name - msg.app_path = APP_CONTEXT.path + msg.app_name = ::Contrast::APP_CONTEXT.app_name + msg.app_path = ::Contrast::APP_CONTEXT.path msg.app_language = Contrast::Utils::ObjectShare::RUBY - msg.client_id = APP_CONTEXT.client_id + msg.client_id = ::Contrast::APP_CONTEXT.client_id msg.message_count = message_count - msg.pid = APP_CONTEXT.pid - msg.ppid = APP_CONTEXT.ppid + msg.pid = ::Contrast::APP_CONTEXT.pid + msg.ppid = ::Contrast::APP_CONTEXT.ppid msg.append_event(event) msg end end end