uniq_logger 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/uniq_logger.rb +0 -1
- data/lib/uniq_logger/base.rb +4 -4
- data/lib/uniq_logger/version.rb +1 -1
- data/spec/lib/uniq_logger_spec.rb +4 -4
- data/uniq_logger-0.1.2.gem +0 -0
- metadata +2 -1
data/Gemfile.lock
CHANGED
data/lib/uniq_logger.rb
CHANGED
data/lib/uniq_logger/base.rb
CHANGED
@@ -37,7 +37,7 @@ module UniqLogger
|
|
37
37
|
end
|
38
38
|
|
39
39
|
#Use Log Rotator?
|
40
|
-
if ['day','month','year'].include?(config["
|
40
|
+
if ['day','month','year'].include?(config["log_rotator"])
|
41
41
|
logger_prefix = get_current_logger_prefix()
|
42
42
|
rotator_logfilename = File.join(config["path_to_local_logfiles"], "#{config['log_rotator_prefix']}#{logger_prefix}.log")
|
43
43
|
rotator_logfile = File.open( File.expand_path(rotator_logfilename), "a" )
|
@@ -62,7 +62,7 @@ module UniqLogger
|
|
62
62
|
end
|
63
63
|
|
64
64
|
def get_current_logger_prefix
|
65
|
-
case config["
|
65
|
+
case config["log_rotator"]
|
66
66
|
when "day"
|
67
67
|
filename_prefix = Time.now.strftime("%d-%m-%Y")
|
68
68
|
when "month"
|
@@ -93,9 +93,9 @@ module UniqLogger
|
|
93
93
|
request.basic_auth(config["remote"]["basic_auth"]["username"], config["remote"]["basic_auth"]["password"])
|
94
94
|
end
|
95
95
|
|
96
|
-
request.
|
96
|
+
request.form_data = { param_id.to_sym => uniq_id, param_data.to_sym => data_to_save.to_json }
|
97
97
|
response = http.request(request)
|
98
|
-
|
98
|
+
|
99
99
|
json = JSON.parse response.body
|
100
100
|
if json['response'] == "true"
|
101
101
|
return true
|
data/lib/uniq_logger/version.rb
CHANGED
@@ -40,21 +40,21 @@ describe UniqLogger::Base do
|
|
40
40
|
end
|
41
41
|
|
42
42
|
it 'should write a log rotator to a logfile per day' do
|
43
|
-
@logger.config["
|
43
|
+
@logger.config["log_rotator"] = "day"
|
44
44
|
expect(@logger.create("12345", ["Vorname", "Nachname", "Strasse"])).to eq(true)
|
45
45
|
expect(@logger.create("12346", ["Vorname2", "Nachname2", "Strasse2"])).to eq(true)
|
46
46
|
expect(@logger.create("12346", ["Vorname3", "Nachname3", "Strasse3"])).to eq(true)
|
47
47
|
end
|
48
48
|
|
49
49
|
it 'should write a log rotator to a logfile per month' do
|
50
|
-
@logger.config["
|
50
|
+
@logger.config["log_rotator"] = "month"
|
51
51
|
expect(@logger.create("12345", ["Vorname", "Nachname", "Strasse"])).to eq(true)
|
52
52
|
expect(@logger.create("12346", ["Vorname2", "Nachname2", "Strasse2"])).to eq(true)
|
53
53
|
expect(@logger.create("12346", ["Vorname3", "Nachname3", "Strasse3"])).to eq(true)
|
54
54
|
end
|
55
55
|
|
56
56
|
it 'should write a log rotator to a logfile per year' do
|
57
|
-
@logger.config["
|
57
|
+
@logger.config["log_rotator"] = "year"
|
58
58
|
expect(@logger.create("12345", ["Vorname", "Nachname", "Strasse"])).to eq(true)
|
59
59
|
expect(@logger.create("12346", ["Vorname2", "Nachname2", "Strasse2"])).to eq(true)
|
60
60
|
expect(@logger.create("12346", ["Vorname3", "Nachname3", "Strasse3"])).to eq(true)
|
@@ -65,7 +65,7 @@ describe UniqLogger::Base do
|
|
65
65
|
@logger.config["remote"]["auth_token"] = "QviQAtx1mq1ZCWC12RUy"
|
66
66
|
@logger.config["remote"]["server"] = "http://localhost:3000"
|
67
67
|
@logger.config["remote"]["endpoint"] = "/crm/api/v1/loggers.json"
|
68
|
-
expect(@logger.create("
|
68
|
+
expect(@logger.create("1112", ["Remote", "Server", "Strasse3"])).to eq(true)
|
69
69
|
end
|
70
70
|
|
71
71
|
|
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uniq_logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -115,6 +115,7 @@ files:
|
|
115
115
|
- spec/spec_helper.rb
|
116
116
|
- template/uniq_logger.yml
|
117
117
|
- uniq_logger-0.1.1.gem
|
118
|
+
- uniq_logger-0.1.2.gem
|
118
119
|
- uniq_logger.gemspec
|
119
120
|
homepage: https://github.com/ikuseiGmbH/uniq_logger
|
120
121
|
licenses:
|