onlylogs 0.4.3 → 0.4.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a035dd688ba96b45a9c6546d2a3673684fc9a4928c48228f7064bc13b75d2801
4
- data.tar.gz: 2bd5f4fdbf5f9a7b64aebe9a0ef4c035dfb536d48117ab36f3ffe42c12ddab73
3
+ metadata.gz: 475fe2ae62cd3978f80a766582241d7ae0201176f6e00e93a25710c6b655bd3e
4
+ data.tar.gz: fc3f2a55ee2211fd8920ff0dd1e16c43dd24128a3457cc06b0ee3de5a1b02579
5
5
  SHA512:
6
- metadata.gz: c5710f733a8f45d326aad2b1eeb767b7fc7c507b16bfa5bd3a58980c846c39494358016703bd3c51179cc7ca11ea72f725cc01f347d139dc067e7887f9470b97
7
- data.tar.gz: ffd686f5f9be15e8150125feb50b7d37008f4c46f5147d174b95e599125652fddb1f5e7f0975204bab857b5cd2b721c9b536e07f5afb519ee2e456bc128acb8e
6
+ metadata.gz: f0a987a309c73c74264b028110ca04c4e15644bc4900efcff482c020354e4c387f7d8bd10ef9f56200337b41d29688e0cf7f7105e9691890424096e3dcc0db68
7
+ data.tar.gz: fdfdbc117ed93a3903435be55897a226a0aa5381581f56ee9676c1cc39d16886b96581f45e0357b81722cb87eb40c1d42be0c364fbd901516a0bbd40aa45f37f
@@ -88,7 +88,7 @@ module Onlylogs
88
88
  while (line = file.gets)
89
89
  if line.end_with?("\n")
90
90
  # Complete line - store as simple string
91
- lines << line.chomp
91
+ lines << line.chomp.force_encoding(Encoding::UTF_8).scrub
92
92
  self.last_position = file.pos
93
93
  else
94
94
  # Incomplete line at EOF - skip it
@@ -23,7 +23,7 @@ module Onlylogs
23
23
  io.each_line do |line|
24
24
  # Line numbers are no longer outputted by super_grep/super_ripgrep
25
25
  # Use String.new to create a copy and prevent memory retention from IO buffers
26
- content = String.new(line.chomp)
26
+ content = String.new(line.chomp, encoding: Encoding::UTF_8).scrub
27
27
 
28
28
  if block_given?
29
29
  yield content
@@ -4,8 +4,6 @@
4
4
  <title>Onlylogs</title>
5
5
  <%= csrf_meta_tags %>
6
6
  <%= csp_meta_tag %>
7
- <%= favicon_link_tag "onlylogs/favicon/favicon.ico" %>
8
- <%= favicon_link_tag "onlylogs/favicon/favicon.svg", type: "image/svg+xml" %>
9
7
 
10
8
  <%= yield :head %>
11
9
 
@@ -26,21 +26,6 @@
26
26
 
27
27
  .clusterize-content {
28
28
  outline: 0;
29
- counter-reset: line-number;
30
- }
31
-
32
- pre {
33
- counter-increment: line-number;
34
-
35
- &::before {
36
- content: counter(line-number);
37
- color: #aaa;
38
- user-select: none;
39
- margin-right: 0.5em;
40
- display: inline-block;
41
- text-align: right;
42
- min-width: 3.5em;
43
- }
44
29
  }
45
30
 
46
31
  .color-success {
@@ -25,10 +25,16 @@ module Onlylogs
25
25
  @queue = Queue.new
26
26
  @mutex = Mutex.new
27
27
 
28
- start_sender if @drain_url
28
+ if @drain_url
29
+ start_sender
30
+ else
31
+ $stderr.puts "Onlylogs::HttpLogger error: ONLYLOGS_DRAIN_URL is not set; logger is disabled."
32
+ end
29
33
  end
30
34
 
31
35
  def add(severity, message = nil, progname = nil, &block)
36
+ return true unless @drain_url
37
+
32
38
  if message.nil?
33
39
  if block_given?
34
40
  message = block.call
@@ -1,3 +1,3 @@
1
1
  module Onlylogs
2
- VERSION = "0.4.3"
2
+ VERSION = "0.4.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: onlylogs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alessandro Rodi