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 +4 -4
- data/lib/after_do/logging/aspect.rb +4 -6
- data/lib/after_do/logging/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7712a382fdbdb70b04e12525cf1c7aa0129e1b8c
|
4
|
+
data.tar.gz: 65290a1bfcb4dccd4ec6a62125c6182b018f0c1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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(
|
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(
|
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(
|
31
|
+
def log_step(prefix, method, args)
|
34
32
|
arg_text = args.map(&:inspect).join(', ')
|
35
|
-
msg = "
|
33
|
+
msg = "#{prefix}: #{method}(#{arg_text})"
|
36
34
|
logger.info(msg)
|
37
35
|
end
|
38
36
|
end
|