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.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- uniq_logger (0.1.2)
4
+ uniq_logger (0.1.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -3,7 +3,6 @@ require 'yaml'
3
3
  require 'net/http'
4
4
  require 'uri'
5
5
  require 'json'
6
- require 'pry'
7
6
  require "uniq_logger/configuration"
8
7
  require "uniq_logger/version"
9
8
 
@@ -37,7 +37,7 @@ module UniqLogger
37
37
  end
38
38
 
39
39
  #Use Log Rotator?
40
- if ['day','month','year'].include?(config["global_logger"])
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["global_logger"]
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.body = { param_id.to_sym => uniq_id, param_data.to_sym => data_to_save }.to_s
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
@@ -1,3 +1,3 @@
1
1
  module UniqLogger
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
@@ -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["global_logger"] = "day"
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["global_logger"] = "month"
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["global_logger"] = "year"
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("1111", ["Remote", "Server", "Strasse3"])).to eq(true)
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.3
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: