metova-logger 0.0.1 → 0.0.2

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
  SHA1:
3
- metadata.gz: f9b7fc526ed8f9dc4802b7736441065fc43f822e
4
- data.tar.gz: 74648fedade9e6abc6ff99c9a3074db1120ec129
3
+ metadata.gz: 4284489f016c362a76d55d9987b136bc55882922
4
+ data.tar.gz: d274d0521e4ff4042ef655ac4e74f8cf4c944f7b
5
5
  SHA512:
6
- metadata.gz: 2b689166cfee19dab3f8b271670929153107abcc2863675028a6c107be021008f96fc3842f8eef521152ba48db28fd86d1fbdb97f317f43902c8ec286cab849d
7
- data.tar.gz: 8c09d6a48ae26d35a1b2de62c965de6eafd89e667c85407ddcea89b0b4b3c522c4bc805148c966857e0ddc991139ba74a5d25bedca62cdd59ab2c5cb7c5bc45f
6
+ metadata.gz: a39ba60372371fc247992108a83fe8df02766137bdba57418a441906643ea44b37e1513ea874cdf481ecf8312baa3728720f370830be779bd00965075fd3783c
7
+ data.tar.gz: 73f601ab2d47cc6f0918d5c7f7e41ba449c22e2d74e433322ddd684119af401b1325fb07bddfae693c9ea00e32d8a1c6e9de63416fb3764b0f37f2b62e57b766
@@ -1,18 +1,20 @@
1
- module MetovaLogs
2
- module ControllerPatch
1
+ module Metova
2
+ module Logger
3
+ module ControllerPatch
3
4
 
4
- def append_info_to_payload(payload)
5
- super
6
- payload[:ip] = request.remote_ip
7
- if current_user
8
- payload[:user] = [
9
- (current_user.try(:email) || 'NOEMAIL'),
10
- current_user.id
11
- ].join('/')
5
+ def append_info_to_payload(payload)
6
+ super
7
+ payload[:ip] = request.remote_ip
8
+ if current_user
9
+ payload[:user] = [
10
+ (current_user.try(:email) || 'NOEMAIL'),
11
+ current_user.id
12
+ ].join('/')
13
+ end
12
14
  end
13
- end
14
15
 
16
+ end
15
17
  end
16
18
  end
17
19
 
18
- ActionController::Base.send :include, MetovaLogs::ControllerPatch
20
+ ActionController::Base.send :include, Metova::Logger::ControllerPatch
@@ -4,22 +4,20 @@ require 'lograge'
4
4
  module Metova
5
5
  module Logger
6
6
  class Railtie < ::Rails::Railtie
7
- initializer "metova.logger" do |_|
8
7
 
9
- config.log_tags = [
10
- lambda { |request| request.uuid[0..15] }
11
- ]
12
-
13
- config.lograge.enabled = true
14
- config.lograge.custom_options = lambda do |event|
15
- {
16
- time: event.time,
17
- user: event.payload[:user],
18
- ip: event.payload[:ip],
19
- }
20
- end
8
+ config.log_tags = [
9
+ lambda { |request| request.uuid[0..15] }
10
+ ]
21
11
 
12
+ config.lograge.enabled = true
13
+ config.lograge.custom_options = lambda do |event|
14
+ {
15
+ time: event.time,
16
+ user: event.payload[:user],
17
+ ip: event.payload[:ip],
18
+ }
22
19
  end
20
+
23
21
  end
24
22
  end
25
23
  end
@@ -1,5 +1,5 @@
1
1
  module Metova
2
2
  module Logger
3
- VERSION = "0.0.1"
3
+ VERSION = '0.0.2'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metova-logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Logan Serman
@@ -78,7 +78,6 @@ files:
78
78
  - LICENSE.txt
79
79
  - README.md
80
80
  - Rakefile
81
- - lib/metova/logger.rb
82
81
  - lib/metova/logger/controller_patch.rb
83
82
  - lib/metova/logger/railtie.rb
84
83
  - lib/metova/logger/version.rb
data/lib/metova/logger.rb DELETED
@@ -1,8 +0,0 @@
1
- require "metova/logger/version"
2
- require "metova/logger/railtie"
3
- require "metova/logger/controller_patch"
4
-
5
- module Metova
6
- module Logger
7
- end
8
- end