lokilogger 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.adoc +2 -1
- data/lib/lokilogger/client.rb +3 -3
- data/lib/lokilogger/version.rb +1 -1
- data/lokilogger.gemspec +0 -3
- 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: 2b658e3b80bf4ab3cc950ab3d9112398a2572a0be682319b7f5ee5561e95427f
|
4
|
+
data.tar.gz: 7be0372d1f05446788643cc62564a932364bfb942b8eabb5acc37584891bcd6e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc550875c2e5ba7930c1c87282be7f14e28c9262f7838333246c9670374d5b45f733869bfc12bd225e965260f19258b79e7d71cbaf1320e7bd095b1beadb4799
|
7
|
+
data.tar.gz: e881dfa29a1a2fb8dc44904d2059a75bf7d0b1465880551dc35fb7215c746800af9ff269d6fc6bd6f780d8a7f3197e0c167c00609b899805ad4dab17af97986e
|
data/README.adoc
CHANGED
@@ -59,7 +59,8 @@ Start by creating a new logger instance:
|
|
59
59
|
|
60
60
|
[source,ruby]
|
61
61
|
----
|
62
|
-
#
|
62
|
+
# required: url, log_level, version and tags
|
63
|
+
# optional: username and password (if one of them is nil, no auth will be used)
|
63
64
|
logger = Lokilogger.new({url:, log_level: 0, version: "v1", username:, password:, tags: {foo: "bar"}})
|
64
65
|
----
|
65
66
|
|
data/lib/lokilogger/client.rb
CHANGED
@@ -17,15 +17,15 @@ module Lokilogger
|
|
17
17
|
|
18
18
|
Faraday.default_adapter = :async_http
|
19
19
|
@conn = Faraday.new url: @config[:url], headers: {"Content-Type" => "application/json"}, ssl: ssl_options, proxy: proxy_options, request: request_options do |builder|
|
20
|
-
|
20
|
+
if @config[:username] && @config[:password]
|
21
|
+
builder.request :authorization, :basic, @config[:username], @config[:password]
|
22
|
+
end
|
21
23
|
end
|
22
24
|
end
|
23
25
|
|
24
26
|
def check_config
|
25
27
|
fail ConfigError, "missing/malformed url in config" if !@config[:url] || @config[:url] !~ %r{^(http|https)://}
|
26
28
|
fail ConfigError, "missing version in config" unless @config[:version]
|
27
|
-
fail ConfigError, "missing auth username in config" unless @config[:username]
|
28
|
-
fail ConfigError, "missing auth password in config" unless @config[:password]
|
29
29
|
fail ConfigError, "missing tags in config" unless @config[:tags]
|
30
30
|
fail ConfigError, "missing log_level in config" unless @config[:log_level]
|
31
31
|
end
|
data/lib/lokilogger/version.rb
CHANGED
data/lokilogger.gemspec
CHANGED
@@ -15,9 +15,6 @@ Gem::Specification.new do |spec|
|
|
15
15
|
|
16
16
|
spec.metadata = {"label" => "lokilogger", "rubygems_mfa_required" => "true"}
|
17
17
|
|
18
|
-
#spec.signing_key = Gem.default_key_path
|
19
|
-
#spec.cert_chain = [Gem.default_cert_path]
|
20
|
-
|
21
18
|
spec.required_ruby_version = "~> 3.2"
|
22
19
|
spec.add_dependency "async", "~> 2.6", ">= 2.6.5"
|
23
20
|
spec.add_dependency "async-http-faraday", "~> 0.12.0"
|