lsslog 0.1.1.pre.rc1 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lsslog.rb +14 -6
- data/lib/lsslog/services/base.rb +8 -1
- data/lib/lsslog/services/get_lss_config.rb +1 -5
- data/lib/lsslog/services/get_version.rb +1 -5
- data/lib/lsslog/services/remove_lss_config.rb +1 -4
- data/lib/lsslog/services/set_lss_config.rb +1 -4
- data/lib/lsslog/services/set_trans_exp_time.rb +1 -4
- data/lib/lsslog/services/write_log.rb +1 -4
- data/lib/lsslog/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 38c42632c9b012618112b06f0b4e4a426727870dfcfca869817788ac6f24ebbb
|
4
|
+
data.tar.gz: 99ff0973360cebcb021c0bf2e2f948e9318e6898b17ddc8ad375915e557a732a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28e87422f7deedc55c73a1a634e7f413f2f5c2efbddd9595fbf06300415ffcfd883af1f24ff499ea2ba73c28e6a8324c4c1b166107869c5e96400aa175e07797
|
7
|
+
data.tar.gz: 6ff823b5b8eee6f3e422e0c2a7c4bdefa28da7bcd0b509271ea86582a6b9d0d5668e923e14721bf40c84679f75a2b46767e2463a7f13b003fd5f715fd4446f49
|
data/lib/lsslog.rb
CHANGED
@@ -15,13 +15,21 @@ module Lsslog
|
|
15
15
|
|
16
16
|
class << self
|
17
17
|
attr_writer :configuration
|
18
|
-
end
|
19
18
|
|
20
|
-
|
21
|
-
|
22
|
-
|
19
|
+
def logger
|
20
|
+
@@logger ||= defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
|
21
|
+
end
|
22
|
+
|
23
|
+
def logger=(logger)
|
24
|
+
@@logger = logger
|
25
|
+
end
|
26
|
+
|
27
|
+
def configuration
|
28
|
+
@configuration ||= Configuration.new
|
29
|
+
end
|
23
30
|
|
24
|
-
|
25
|
-
|
31
|
+
def configure
|
32
|
+
yield(configuration)
|
33
|
+
end
|
26
34
|
end
|
27
35
|
end
|
data/lib/lsslog/services/base.rb
CHANGED
@@ -11,7 +11,13 @@ module Lsslog
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def self.call(*args)
|
14
|
-
new.call(*args)
|
14
|
+
response = new.call(*args)
|
15
|
+
|
16
|
+
Lsslog.logger.info "#{self.name.demodulize}: #{response.to_json}"
|
17
|
+
|
18
|
+
response
|
19
|
+
rescue GRPC::BadStatus => e
|
20
|
+
Lsslog.logger.info "ERROR: #{e.message}"
|
15
21
|
end
|
16
22
|
|
17
23
|
private
|
@@ -19,6 +25,7 @@ module Lsslog
|
|
19
25
|
def lss_host
|
20
26
|
@lss_host ||= ::Lsslog.configuration.lss_host
|
21
27
|
raise 'Lsslog.configuration.lss_host is missing' unless @lss_host
|
28
|
+
|
22
29
|
@lss_host
|
23
30
|
end
|
24
31
|
end
|
@@ -2,11 +2,7 @@ module Lsslog
|
|
2
2
|
module Services
|
3
3
|
class GetLssConfig < Base
|
4
4
|
def call(flow_id = nil)
|
5
|
-
|
6
|
-
Rails.logger.info "GetLssConfig: #{response.to_json}"
|
7
|
-
response
|
8
|
-
rescue GRPC::BadStatus => e
|
9
|
-
Rails.logger.info "ERROR: #{e.message}"
|
5
|
+
client.get_lss_config(Lsslog::LssConfig.new(flow_id: flow_id))
|
10
6
|
end
|
11
7
|
end
|
12
8
|
end
|
@@ -2,11 +2,7 @@ module Lsslog
|
|
2
2
|
module Services
|
3
3
|
class GetVersion < Base
|
4
4
|
def call
|
5
|
-
|
6
|
-
Rails.logger.info "GetVersion: #{response.to_json}"
|
7
|
-
response
|
8
|
-
rescue GRPC::BadStatus => e
|
9
|
-
Rails.logger.info "ERROR: #{e.message}"
|
5
|
+
client.get_version(Lsslog::EmptyIn.new)
|
10
6
|
end
|
11
7
|
end
|
12
8
|
end
|
@@ -2,10 +2,7 @@ module Lsslog
|
|
2
2
|
module Services
|
3
3
|
class RemoveLssConfig < Base
|
4
4
|
def call(flow_id)
|
5
|
-
|
6
|
-
Rails.logger.info "RemoveLssConfig: #{response.to_json}"
|
7
|
-
rescue GRPC::BadStatus => e
|
8
|
-
Rails.logger.info "ERROR: #{e.message}"
|
5
|
+
client.remove_lss_config(Lsslog::LssConfig.new(flow_id: flow_id))
|
9
6
|
end
|
10
7
|
end
|
11
8
|
end
|
@@ -2,10 +2,7 @@ module Lsslog
|
|
2
2
|
module Services
|
3
3
|
class SetLssConfig < Base
|
4
4
|
def call(config)
|
5
|
-
|
6
|
-
Rails.logger.info "SetLssConfig: #{response.to_json}"
|
7
|
-
rescue GRPC::BadStatus => e
|
8
|
-
Rails.logger.info "ERROR: #{e.message}"
|
5
|
+
client.set_lss_config(Lsslog::LssConfig.new(config))
|
9
6
|
end
|
10
7
|
end
|
11
8
|
end
|
@@ -2,10 +2,7 @@ module Lsslog
|
|
2
2
|
module Services
|
3
3
|
class SetTransExpTime < Base
|
4
4
|
def call(config)
|
5
|
-
|
6
|
-
Rails.logger.info "WriteLog: #{response.to_json}"
|
7
|
-
rescue GRPC::BadStatus => e
|
8
|
-
Rails.logger.info "ERROR: #{e.message}"
|
5
|
+
client.set_trans_exp_time(Lsslog::TransExpTime.new(config))
|
9
6
|
end
|
10
7
|
end
|
11
8
|
end
|
@@ -2,10 +2,7 @@ module Lsslog
|
|
2
2
|
module Services
|
3
3
|
class WriteLog < Base
|
4
4
|
def call(message)
|
5
|
-
|
6
|
-
Rails.logger.info "WriteLog: #{response.to_json}"
|
7
|
-
rescue GRPC::BadStatus => e
|
8
|
-
Rails.logger.info "ERROR: #{e.message}"
|
5
|
+
client.write_log(Lsslog::LssLog.new(message))
|
9
6
|
end
|
10
7
|
end
|
11
8
|
end
|
data/lib/lsslog/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lsslog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.1
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thanh Ngo
|
@@ -122,9 +122,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
122
122
|
version: '0'
|
123
123
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
124
124
|
requirements:
|
125
|
-
- - "
|
125
|
+
- - ">="
|
126
126
|
- !ruby/object:Gem::Version
|
127
|
-
version:
|
127
|
+
version: '0'
|
128
128
|
requirements: []
|
129
129
|
rubygems_version: 3.1.2
|
130
130
|
signing_key:
|