RTALogger 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +4 -0
- data/lib/RTALogger/version.rb +1 -1
- data/lib/log_manager.rb +6 -6
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7150b28c7b37eef2f430e19bf5226f846c8aef4ea030392359a66c17ff077f90
|
|
4
|
+
data.tar.gz: bae174a79a72f23ce047004e74d2b545ed56c0c70e181a18f076983bcb131c32
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 66f2bdc747626b74e75ac868885455bf5391698a77add2c6a8a90d6e04815c77f351f47830291441b3f4387259fe92c51dbd11d810d7cfe78e4bd2b1c7d92fe3
|
|
7
|
+
data.tar.gz: 2950a3a76bf71b56f0539e90ef2a71a7a8cdc173082c565a4d24e656bb1f90ff781d38598820f817d5d67f9594fa7a78bb690b61cb5ef36750724ed9772db63a
|
data/Gemfile.lock
CHANGED
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.
|
data/lib/RTALogger/version.rb
CHANGED
data/lib/log_manager.rb
CHANGED
|
@@ -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.
|
|
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
|
+
date: 2020-12-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: fluent-logger
|