Class: SdkCodes

Inherits:
Object
  • Object
show all
Defined in:
lib/ff/ruby/server/sdk/common/sdk_codes.rb

Class Method Summary collapse

Class Method Details

.info_metrics_thread_started(logger) ⇒ Object



44
45
46
# File 'lib/ff/ruby/server/sdk/common/sdk_codes.rb', line 44

def self.info_metrics_thread_started(logger)
  logger.info SdkCodes.sdk_err_msg(7000)
end

.info_poll_started(logger, durationSec) ⇒ Object



9
10
11
# File 'lib/ff/ruby/server/sdk/common/sdk_codes.rb', line 9

def self.info_poll_started(logger, durationSec)
  logger.info SdkCodes.sdk_err_msg(4000, durationSec*1000)
end

.info_polling_stopped(logger) ⇒ Object



32
33
34
# File 'lib/ff/ruby/server/sdk/common/sdk_codes.rb', line 32

def self.info_polling_stopped(logger)
  logger.info SdkCodes.sdk_err_msg(4001)
end

.info_sdk_auth_ok(logger) ⇒ Object



28
29
30
# File 'lib/ff/ruby/server/sdk/common/sdk_codes.rb', line 28

def self.info_sdk_auth_ok(logger)
  logger.info SdkCodes.sdk_err_msg(2000)
end

.info_sdk_init_ok(logger) ⇒ Object



13
14
15
# File 'lib/ff/ruby/server/sdk/common/sdk_codes.rb', line 13

def self.info_sdk_init_ok(logger)
  logger.info SdkCodes.sdk_err_msg(1000)
end

.info_sdk_waiting_to_initialize(logger, timeout) ⇒ Object



17
18
19
20
21
22
23
24
25
26
# File 'lib/ff/ruby/server/sdk/common/sdk_codes.rb', line 17

def self.info_sdk_waiting_to_initialize(logger, timeout)
  if timeout
    message = "with timeout: #{timeout} ms"
  else

    message = "with no timeout"

  end
  logger.info SdkCodes.sdk_err_msg(1003, message)
end

.info_stream_connected(logger) ⇒ Object



36
37
38
# File 'lib/ff/ruby/server/sdk/common/sdk_codes.rb', line 36

def self.info_stream_connected(logger)
  logger.info SdkCodes.sdk_err_msg(5000)
end

.info_stream_event_received(logger, event_json) ⇒ Object



40
41
42
# File 'lib/ff/ruby/server/sdk/common/sdk_codes.rb', line 40

def self.info_stream_event_received(logger, event_json)
  logger.info SdkCodes.sdk_err_msg(5002, event_json)
end

.raise_missing_sdk_key(logger) ⇒ Object



3
4
5
6
7
# File 'lib/ff/ruby/server/sdk/common/sdk_codes.rb', line 3

def self.raise_missing_sdk_key(logger)
  msg = SdkCodes.sdk_err_msg(1002)
  logger.error msg
  raise msg
end

.warn_auth_failed_srv_defaults(logger) ⇒ Object



55
56
57
# File 'lib/ff/ruby/server/sdk/common/sdk_codes.rb', line 55

def self.warn_auth_failed_srv_defaults(logger)
  logger.warn SdkCodes.sdk_err_msg(2001)
end

.warn_auth_retying(logger, attempt) ⇒ Object



59
60
61
# File 'lib/ff/ruby/server/sdk/common/sdk_codes.rb', line 59

def self.warn_auth_retying(logger, attempt)
  logger.warn SdkCodes.sdk_err_msg(2003, ", attempt #{attempt}")
end

.warn_bucket_by_attr_not_found(logger, attr_name, new_value) ⇒ Object



75
76
77
78
79
80
# File 'lib/ff/ruby/server/sdk/common/sdk_codes.rb', line 75

def self.warn_bucket_by_attr_not_found(logger, attr_name, new_value)
  if new_value == nil
    new_value = "NOT FOUND"
  end
  logger.warn SdkCodes.sdk_err_msg(6002, "missing=%s, using value=%s" % [attr_name, new_value])
end

.warn_default_variation_served(logger, identifier, target, default) ⇒ Object



71
72
73
# File 'lib/ff/ruby/server/sdk/common/sdk_codes.rb', line 71

def self.warn_default_variation_served(logger, identifier, target, default)
  logger.warn SdkCodes.sdk_err_msg(6001, "identifier=%s, target=%s, default=%s" % [identifier, target.identifier, default])
end

.warn_metrics_evaluations_max_size_exceeded(logger) ⇒ Object



52
53
54
# File 'lib/ff/ruby/server/sdk/common/sdk_codes.rb', line 52

def self.warn_metrics_evaluations_max_size_exceeded(logger)
  logger.warn SdkCodes.sdk_err_msg(7007)
end

.warn_metrics_targets_max_size_exceeded(logger) ⇒ Object



48
49
50
# File 'lib/ff/ruby/server/sdk/common/sdk_codes.rb', line 48

def self.warn_metrics_targets_max_size_exceeded(logger)
  logger.warn SdkCodes.sdk_err_msg(7004)
end

.warn_post_metrics_failed(logger, reason) ⇒ Object



67
68
69
# File 'lib/ff/ruby/server/sdk/common/sdk_codes.rb', line 67

def self.warn_post_metrics_failed(logger, reason)
  logger.warn SdkCodes.sdk_err_msg(7002, reason)
end

.warn_stream_disconnected(logger, reason) ⇒ Object



63
64
65
# File 'lib/ff/ruby/server/sdk/common/sdk_codes.rb', line 63

def self.warn_stream_disconnected(logger, reason)
  logger.warn SdkCodes.sdk_err_msg(5001, reason)
end