RTALogger 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9d28795fc1ab81da8fe17aea8489d11559cd05d06caa7545a30ac5abcda1e5eb
4
- data.tar.gz: 5bd61d89f1d4ec087294845f742c4799c3899590adae9366ab013f67a30924cf
3
+ metadata.gz: 7150b28c7b37eef2f430e19bf5226f846c8aef4ea030392359a66c17ff077f90
4
+ data.tar.gz: bae174a79a72f23ce047004e74d2b545ed56c0c70e181a18f076983bcb131c32
5
5
  SHA512:
6
- metadata.gz: a0264ccb95941af08eb9ea0be0019a03e7151e7f5eb8a570fec66c421ebc8f031df7e3ac712aec515c603c66996d1c6976d95d1e4a1326be20c4946fb9ebcb22
7
- data.tar.gz: 62ad72d8e5443de241cff8c9c8fc30c34006dd8fbae052f5388a275ecfea104b42a6225f5eb358df774a1811c7c64a4b0527b86120a6e9e505f8be0e09a2523c
6
+ metadata.gz: 66f2bdc747626b74e75ac868885455bf5391698a77add2c6a8a90d6e04815c77f351f47830291441b3f4387259fe92c51dbd11d810d7cfe78e4bd2b1c7d92fe3
7
+ data.tar.gz: 2950a3a76bf71b56f0539e90ef2a71a7a8cdc173082c565a4d24e656bb1f90ff781d38598820f817d5d67f9594fa7a78bb690b61cb5ef36750724ed9772db63a
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- RTALogger (0.1.2)
4
+ RTALogger (0.1.3)
5
5
  fluent-logger (~> 0.9)
6
6
  jbuilder (~> 2.10)
7
7
 
data/README.md CHANGED
@@ -6,6 +6,10 @@ Also provide multiple extendable log repositories including wrapping existing lo
6
6
  All log manager's main features are configable through a json config file.
7
7
 
8
8
  Main purposes of developing this gem are:
9
+ - Creating standard logging API to seperate application from existing variety of loggers.
10
+ - Wrapping around existing loggers so get advantage of different loggers at the same time.
11
+ - Make it possible to easily replace a logger component with a new one. (for example Rails standard Logger with Fluentd)
12
+ without any changes in the consumer application.
9
13
  - Creating easy to use logger interface.
10
14
  - Apply some rules and restrictions about log structure and data format, which prevents chaos in application log information.
11
15
  - No interrupt or wait time for log consumer modules.
@@ -1,3 +1,3 @@
1
1
  module RTALogger
2
- VERSION = '0.1.2'.freeze
2
+ VERSION = '0.1.3'.freeze
3
3
  end
@@ -84,25 +84,25 @@ module RTALogger
84
84
 
85
85
  private
86
86
 
87
- def load_config_from_json_file(config_file_name)
87
+ def load_config_from_json_file(config_file_name, manager_name = '')
88
88
  config_file = File.open config_file_name
89
89
  config_json = JSON.load config_file
90
- config_json = extract_config(config_json)
90
+ config_json = extract_config(config_json, manager_name)
91
91
  config_json
92
92
  end
93
93
 
94
- def load_config_from_json_string(config_string)
94
+ def load_config_from_json_string(config_string, manager_name = '')
95
95
  config_json = JSON.parse(config_string)
96
- config_json = extract_config(config_json)
96
+ config_json = extract_config(config_json, manager_name)
97
97
  config_json
98
98
  end
99
99
 
100
- def extract_config(json_data)
100
+ def extract_config(json_data, manager_name = '')
101
101
  config_json = json_data['RTALogger']
102
102
  raise 'RTALogger configuration not found!' unless config_json
103
103
  raise 'Log_Managers section does not exists json configuration' unless config_json['Log_Managers']
104
104
  raise 'No config manager defined in json configuration' unless config_json['Log_Managers'].count.positive?
105
- manager_name = config_json['Default_Manager']
105
+ manager_name = config_json['Default_Manager'] if manager_name.blank?
106
106
  unless manager_name.to_s.strip.empty?
107
107
  config_json = config_json['Log_Managers'].find { |item| item['Manager_Name'] == manager_name }
108
108
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: RTALogger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Babak Bahreini, RTA Backend Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-11-08 00:00:00.000000000 Z
11
+ date: 2020-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluent-logger