class Gapic::LoggingConcerns::StubLogger::LogEntryBuilder


Builder for a log entry, passed to {StubLogger#log}.
@private
#

def build

def build
  Google::Logging::Message.from message: message, source_location: source_location, fields: fields
end

def initialize system_name: nil,

def initialize system_name: nil,
               service: nil,
               endpoint: nil,
               client_id: nil
  @system_name = system_name
  @service = service
  @endpoint = endpoint
  @client_id = client_id
  @message = nil
  @caller_locations = caller_locations
  @fields = { "clientId" => @client_id }
end

def set name, value

def set name, value
  fields[name] = value
end

def set_credentials_fields creds

def set_credentials_fields creds
  creds = creds.client if creds.respond_to? :client
  set "credentialsId", creds.object_id
  set "credentialsType", creds.class.name
  set "credentialsScope", creds.scope if creds.respond_to? :scope
  set "useSelfSignedJWT", creds.enable_self_signed_jwt? if creds.respond_to? :enable_self_signed_jwt?
  set "universeDomain", creds.universe_domain if creds.respond_to? :universe_domain
end

def set_service

def set_service
  set "serviceName", service
end

def set_source_location_from locations

def set_source_location_from locations
  @caller_locations = locations
  @source_location = nil
end

def set_system_name

def set_system_name
  set "system", system_name
end

def source_location

def source_location
  @source_location ||= Google::Logging::SourceLocation.for_caller omit_files: OMIT_FILES,
                                                                  locations: @caller_locations
end