onlylogs 0.4.3 → 0.4.5

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: 0b9969627b74355a1b0c31a2314961e45ed78558c10b2c181c83c8303c4128a5
4
+ data.tar.gz: b01ad9a6faa8d94e982a938d8c1b7afa4e25fe277ddbd6d0468546d9c9272f64
5
5
  SHA512:
6
- metadata.gz: c5710f733a8f45d326aad2b1eeb767b7fc7c507b16bfa5bd3a58980c846c39494358016703bd3c51179cc7ca11ea72f725cc01f347d139dc067e7887f9470b97
7
- data.tar.gz: ffd686f5f9be15e8150125feb50b7d37008f4c46f5147d174b95e599125652fddb1f5e7f0975204bab857b5cd2b721c9b536e07f5afb519ee2e456bc128acb8e
6
+ metadata.gz: d40db595e6c21fdff61f5f0f0c0eef96a1be49b35bb79a0e57fc0676b9fdde401d7e644a42a9523f54a79f00150646e0413c352a774437c33e6c20f60b6ed46c
7
+ data.tar.gz: 433b9d90c250d86e88117f4706304a571b6f34fc72992209aab90427ebb29cc1162dcf9d09a435f23244c55f1c79f3b4fb15985c6c7e189673512587feac7940
@@ -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." # rubocop:disable Style/StderrPuts
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
@@ -39,7 +45,7 @@ module Onlylogs
39
45
  end
40
46
 
41
47
  formatted = format_message(format_severity(severity), Time.now, progname, message.to_s)
42
- @queue << formatted if formatted && @drain_url
48
+ @queue << formatted.chomp if formatted && @drain_url
43
49
  super
44
50
  end
45
51
 
@@ -51,6 +57,7 @@ module Onlylogs
51
57
 
52
58
  def flush
53
59
  send_batch(drain_queue)
60
+ super
54
61
  end
55
62
 
56
63
  private
@@ -1,3 +1,3 @@
1
1
  module Onlylogs
2
- VERSION = "0.4.3"
2
+ VERSION = "0.4.5"
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.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alessandro Rodi