tracia 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +13 -2
- data/lib/tracia/frame.rb +2 -2
- data/lib/tracia/version.rb +1 -1
- data/lib/tracia.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a057298224487297c5fb36d4a5d2ca15afae37f64badea7e9dbece913d43cee1
|
4
|
+
data.tar.gz: 900c6b6927dceb17767762d0624866935c68dfe27a93d053af3d0c3621d96843
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 539b4c266dfba8dd44f219f4cf3c9b52487ce20c7dac9c8d9609d162e74ead02e043b2966a537d3a220c5822dc8b92f1dc1c9ccdfe93de48c687807707827385
|
7
|
+
data.tar.gz: 9a1dcc702267fd56461b7448aa4aae5ef5df83193ba82e36b36c57a6ac9bac5a17d29c5a0bb396a9377d82b57b38295c9315525fa2a274acfdcce5048253c868
|
data/README.md
CHANGED
@@ -42,7 +42,17 @@ end
|
|
42
42
|
|
43
43
|
### Custom Logger
|
44
44
|
|
45
|
-
|
45
|
+
By default, Tracia writes result to STDOUT, you can set it somewhere else
|
46
|
+
|
47
|
+
```ruby
|
48
|
+
file = File.new('/path/to/log.txt', 'w+')
|
49
|
+
|
50
|
+
Tracia.start(logger: Tracia::DefaultLogger.new(out: file)) do
|
51
|
+
# ...
|
52
|
+
end
|
53
|
+
```
|
54
|
+
|
55
|
+
Or you can make a logger class which responds to `call`
|
46
56
|
|
47
57
|
```ruby
|
48
58
|
class MyLogger
|
@@ -50,6 +60,7 @@ class MyLogger
|
|
50
60
|
@database = database
|
51
61
|
end
|
52
62
|
|
63
|
+
# callback method for Tracia
|
53
64
|
def call(root)
|
54
65
|
# ...
|
55
66
|
@database.insert(root)
|
@@ -57,7 +68,7 @@ class MyLogger
|
|
57
68
|
end
|
58
69
|
```
|
59
70
|
|
60
|
-
|
71
|
+
Then pass that logger to Tracia
|
61
72
|
|
62
73
|
```ruby
|
63
74
|
Tracia.start(logger: MyLogger.new(db_connection)) do
|
data/lib/tracia/frame.rb
CHANGED
@@ -7,11 +7,11 @@ class Tracia
|
|
7
7
|
attr_reader :klass, :call_sym, :method_name, :children, :file
|
8
8
|
|
9
9
|
def initialize(klass, call_sym, method_name, file, lineno)
|
10
|
-
@file = file
|
11
|
-
@lineno = lineno
|
12
10
|
@klass = klass
|
13
11
|
@call_sym = call_sym
|
14
12
|
@method_name = method_name
|
13
|
+
@file = file
|
14
|
+
@lineno = lineno
|
15
15
|
@children = []
|
16
16
|
end
|
17
17
|
|
data/lib/tracia/version.rb
CHANGED
data/lib/tracia.rb
CHANGED