slides 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/slides.rb +4 -4
- metadata +1 -1
data/lib/slides.rb
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
module Slides
|
2
2
|
module Log
|
3
|
-
def log(
|
3
|
+
def log(event, attrs = {})
|
4
4
|
unless block_given?
|
5
|
-
str = "#{
|
5
|
+
str = "#{event} #{unparse(attrs)}"
|
6
6
|
mtx.synchronize { $stdout.puts str }
|
7
7
|
else
|
8
8
|
start = Time.now
|
9
|
-
log(
|
9
|
+
log(event, attrs.merge(at: :start))
|
10
10
|
res = yield
|
11
|
-
log(
|
11
|
+
log(event, attrs.merge(at: :finish,
|
12
12
|
elapsed: "#{((Time.now - start) * 1000).to_i}ms"))
|
13
13
|
res
|
14
14
|
end
|