testa_logger 0.1.13 → 0.1.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/testa_logger/logger/dispatcher.rb +7 -1
- data/lib/testa_logger/logger/options.rb +1 -0
- data/lib/testa_logger/logger.rb +8 -6
- data/lib/testa_logger/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6bccba94675dff6f881b604cec301bcea54e1a99b653db95c7ce156ddf8104de
|
4
|
+
data.tar.gz: '05984a867c873368a4da65b0539a7e981cc0119e5076d142408e725066121cc4'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9995ca14b6c4b97370c2600ee5c401f6e8b54447f402d776e3e7f2882ef91d7cb724a0ecea3d418125991b11531ca0f5a2fcc7a7aba611c15b4e60f482a08022
|
7
|
+
data.tar.gz: 15f463df8811cb1d16a72dfbb8b57f440fd73d55eb3ed8566ccc729b47b76831c3889679bf76c6749f406d6eeb66827be94a78275175c9c180dfeda6ece5bbe2
|
data/Gemfile.lock
CHANGED
@@ -9,6 +9,9 @@ module TestaLogger
|
|
9
9
|
def initialize(logger, faye_url, faye_token)
|
10
10
|
@logger = logger
|
11
11
|
@uri = URI.parse(faye_url)
|
12
|
+
@http = Net::HTTP.new(@uri.host, @uri.port)
|
13
|
+
@http.read_timeout = 2
|
14
|
+
@http.open_timeout = 2
|
12
15
|
@faye_token = faye_token
|
13
16
|
@channel = "/logs/live/#{logger.app}/#{logger.group}"
|
14
17
|
@channel += "/#{logger.subgroup}" unless logger.subgroup.nil?
|
@@ -57,7 +60,10 @@ module TestaLogger
|
|
57
60
|
data: { logs: @outbox },
|
58
61
|
ext: { auth_token: @faye_token },
|
59
62
|
}
|
60
|
-
|
63
|
+
|
64
|
+
request = Net::HTTP::Post.new(@uri.request_uri)
|
65
|
+
request.form_data = { message: message.to_json }
|
66
|
+
@http.request(request)
|
61
67
|
@outbox.clear
|
62
68
|
end
|
63
69
|
end
|
data/lib/testa_logger/logger.rb
CHANGED
@@ -80,27 +80,27 @@ module TestaLogger
|
|
80
80
|
options.formatter
|
81
81
|
end
|
82
82
|
|
83
|
-
def debug(tag =
|
83
|
+
def debug(tag = "", *args, &block)
|
84
84
|
add_log_to_queue(DEBUG, tag, args, &block)
|
85
85
|
end
|
86
86
|
|
87
|
-
def info(tag =
|
87
|
+
def info(tag = "", *args, &block)
|
88
88
|
add_log_to_queue(INFO, tag, args, &block)
|
89
89
|
end
|
90
90
|
|
91
|
-
def warn(tag =
|
91
|
+
def warn(tag = "", *args, &block)
|
92
92
|
add_log_to_queue(WARN, tag, args, &block)
|
93
93
|
end
|
94
94
|
|
95
|
-
def error(tag =
|
95
|
+
def error(tag = "", *args, &block)
|
96
96
|
add_log_to_queue(ERROR, tag, args, &block)
|
97
97
|
end
|
98
98
|
|
99
|
-
def fatal(tag =
|
99
|
+
def fatal(tag = "", *args, &block)
|
100
100
|
add_log_to_queue(FATAL, tag, args, &block)
|
101
101
|
end
|
102
102
|
|
103
|
-
def unknown(tag =
|
103
|
+
def unknown(tag = "", *args, &block)
|
104
104
|
add_log_to_queue(UNKNOWN, tag, args, &block)
|
105
105
|
end
|
106
106
|
|
@@ -212,6 +212,8 @@ module TestaLogger
|
|
212
212
|
formatted_severity = format_severity(level)
|
213
213
|
formatted_text = format_message(formatted_severity, time, "", text)
|
214
214
|
|
215
|
+
# after forking process, write thread will stop working in the forked process
|
216
|
+
start_write_thread if @write_thread.nil? || @write_thread.status == false
|
215
217
|
@queue << formatted_text
|
216
218
|
@dispatcher.push(level, time, tag, formatted_text) if options.live
|
217
219
|
end
|
data/lib/testa_logger/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: testa_logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- karlo.razumovic
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-08-
|
11
|
+
date: 2022-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|