microscope_tracer 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: 7643c5e1b0005e105386c53d615cbbfdd9fc31cf
4
- data.tar.gz: fb317d4e561db12dd7decdef4e2c99a46a3202d2
3
+ metadata.gz: ac35cf249a2fc36e0eedffc63588da82a962268d
4
+ data.tar.gz: 979f54c74c8df35bc27cc24eb9d1fef9c409d093
5
5
  SHA512:
6
- metadata.gz: 1ede11290a7d81ef89830609109b7a513c24fb4cdf3167d002269f1f11cbf84c93c5acb8d286da85cbf53286a8e068be1a3ed9a2c99b5f4e581221b7d944d9f4
7
- data.tar.gz: 41765f463a2183041991376d8d5912a582d36e080e04dcd4e2e3137b098e768088a0743715aa475911925f04b5c29117e285ca2f0d36042e62334596d86bc2c6
6
+ metadata.gz: 0766b787e9b852ddcaf6056b7a8187be8951c8538cd907b09c5c0566ca2d6e353c9cebf4a3c0a781a3cdb03ceebb8e6713356cb3d83761c20b3112481291fede
7
+ data.tar.gz: 1215c431b60dcafb944b88a770a6b1f1a24b3f81f5f4d5a47b1762d99ad8732bd21fdf7825138529b269a1e525f2b8947829385a7c2da9b03bec602c219e1930
@@ -4,8 +4,8 @@ require 'microscope_tracer/trace_logger'
4
4
 
5
5
  module MicroscopeTracer
6
6
  class FaradayMiddleware < Faraday::Middleware
7
- def initialize(app,logger = Logger.new($stdout))
8
- @trace_logger = TraceLogger.new(logger)
7
+ def initialize(app,io=$stdout)
8
+ @trace_logger = TraceLogger.new(io)
9
9
  super(app)
10
10
  end
11
11
 
@@ -7,9 +7,9 @@ require 'microscope_tracer/trace_logger'
7
7
  module MicroscopeTracer
8
8
 
9
9
  class RackMiddleware
10
- def initialize(app,logger = Logger.new($stdout))
10
+ def initialize(app,io = $stdout)
11
11
  @app = app
12
- @trace_logger = TraceLogger.new(logger)
12
+ @trace_logger = TraceLogger.new(io)
13
13
  end
14
14
 
15
15
  def call(env)
@@ -1,7 +1,7 @@
1
1
  module MicroscopeTracer
2
2
  class TraceLogger
3
- def initialize(logger)
4
- @logger = logger
3
+ def initialize(io)
4
+ @io = io
5
5
  end
6
6
 
7
7
  def log_server_start(span)
@@ -25,7 +25,8 @@ class TraceLogger
25
25
  def log(type,span,extras={})
26
26
  fields = {type:type,traceId:span.trace_id,spanId:span.span_id,pspanId:span.parent_span_id}.merge(extras)
27
27
  line = fields.map{ |k,v| if v then "#{k}=\"#{v}\"" else nil end }.compact.join(" ")
28
- @logger.info(line)
28
+
29
+ @io.puts(line)
29
30
  end
30
31
  end
31
32
  end
@@ -1,3 +1,3 @@
1
1
  module MicroscopeTracer
2
- VERSION = "0.0.1"
2
+ VERSION = "0.1.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: microscope_tracer
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
  - Pete Hodgson