spider-gazelle 3.0.6 → 3.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/spider-gazelle/logger.rb +7 -3
- data/lib/spider-gazelle/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: '019fff0efc2bb105421dc8bc272a712359488538'
|
4
|
+
data.tar.gz: d73d90a4addbf4968ba678e68320bff312ff2503
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57ec106d3f41d1569a0363fe0557c80b55702132f109dc3a4b8878cb9ae1d57a6e2fcef3b47ca55d3c64868765a92a5feb845f5a0df3dbcf0095acdc5fdbb4f5
|
7
|
+
data.tar.gz: deecf209798f9771d66dddfd84400185ae015d6332c0436e4ff818ed899dbc5d56113dbff0fe84e22bb573b94427cd5f811c484fdbb699eb69646401552a1ee7
|
@@ -5,7 +5,7 @@ require 'libuv'
|
|
5
5
|
module SpiderGazelle
|
6
6
|
class Logger
|
7
7
|
include Singleton
|
8
|
-
attr_reader :level, :thread
|
8
|
+
attr_reader :level, :thread
|
9
9
|
attr_accessor :formatter
|
10
10
|
|
11
11
|
|
@@ -29,7 +29,7 @@ module SpiderGazelle
|
|
29
29
|
|
30
30
|
|
31
31
|
def self.log(data)
|
32
|
-
Logger.instance.
|
32
|
+
Logger.instance.write(data)
|
33
33
|
end
|
34
34
|
|
35
35
|
def level=(level)
|
@@ -78,10 +78,14 @@ module SpiderGazelle
|
|
78
78
|
def verbose(msg = nil)
|
79
79
|
if @verbose
|
80
80
|
msg = yield if block_given?
|
81
|
-
@stdout.write ">> #{msg}\n"
|
81
|
+
@thread.schedule { @stdout.write ">> #{msg}\n" }
|
82
82
|
end
|
83
83
|
end
|
84
84
|
|
85
|
+
def write(msg)
|
86
|
+
@thread.schedule { @stdout.write msg }
|
87
|
+
end
|
88
|
+
|
85
89
|
def print_error(e, msg = nil, trace = nil)
|
86
90
|
message = String.new(msg || e.message)
|
87
91
|
message << "\n#{e.message}" if msg
|