after_do-logging 0.0.1 → 0.1.0

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: 127b1d540e43144825a3dfff1977b1c5dd25e866
4
- data.tar.gz: 7d00f828f88e4e97be6042a08a535cb567dee51a
3
+ metadata.gz: 7712a382fdbdb70b04e12525cf1c7aa0129e1b8c
4
+ data.tar.gz: 65290a1bfcb4dccd4ec6a62125c6182b018f0c1c
5
5
  SHA512:
6
- metadata.gz: e5722d78d4b5a1c17c6ddcc543196519ffcc635d619229b2628f47194ad30204cedca402ca85237335772dc058f128f4b6bdc40d7c6bba9e437ce6b957066614
7
- data.tar.gz: 12056a9b8b3dac271c557e02c103eba3c2d1c55b56747956be1358953f0b144392d7cfddca611c8d61000b1f9cb108cf775a3af0b52107397d8fc4c6b50d469b
6
+ metadata.gz: 465e5ac985f7e23f5dcd9cc814e50febacf26aaa0f04322945936d04f0e952da3b3c88a7a5ebb1b44acc324b17d2e6f35b5684688ab0901995b1f333d5bdc917
7
+ data.tar.gz: 54b0d56adeb5ddd0114a68b8bba11e99fdb267427bc7207b95ca1879f73928d458acee7e586a3635d1c2735e5bd44c22503d7aed98a33b6798b8ffea96f86654
@@ -8,19 +8,17 @@ module AfterDo
8
8
 
9
9
  def log_start(target_method)
10
10
  target_class.before target_method do |*args, _|
11
- start_time = Time.now
12
11
  method = "#{target_class}##{target_method}"
13
12
 
14
- log_step(method, start_time, args)
13
+ log_step('Started', method, args)
15
14
  end
16
15
  end
17
16
 
18
17
  def log_finish(target_method)
19
18
  target_class.after target_method do |*args, _|
20
- finish_time = Time.now
21
19
  method = "#{target_class}##{target_method}"
22
20
 
23
- log_step(method, finish_time, args)
21
+ log_step('Finished', method, args)
24
22
  end
25
23
  end
26
24
 
@@ -30,9 +28,9 @@ module AfterDo
30
28
 
31
29
  private
32
30
 
33
- def log_step(method, time, args)
31
+ def log_step(prefix, method, args)
34
32
  arg_text = args.map(&:inspect).join(', ')
35
- msg = "Finished: Method=#{method} Time=#{time} Args='#{arg_text}'"
33
+ msg = "#{prefix}: #{method}(#{arg_text})"
36
34
  logger.info(msg)
37
35
  end
38
36
  end
@@ -1,5 +1,5 @@
1
1
  module AfterDo
2
2
  module Logging
3
- VERSION = '0.0.1'
3
+ VERSION = '0.1.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: after_do-logging
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rafael da Silva