logster 2.9.6 → 2.10.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,6 +12,7 @@
12
12
  },
13
13
  "scripts": {
14
14
  "build": "ember build",
15
+ "lint": "npm run lint:js && npm run lint:hbs",
15
16
  "lint:hbs": "ember-template-lint .",
16
17
  "lint:js": "eslint .",
17
18
  "start": "ember serve",
@@ -18,7 +18,8 @@ module Logster
18
18
  :gems_dir,
19
19
  :max_env_bytes,
20
20
  :max_env_count_per_message,
21
- :maximum_message_length
21
+ :maximum_message_length,
22
+ :use_full_hostname
22
23
  )
23
24
 
24
25
  attr_writer :subdirectory
@@ -39,6 +40,7 @@ module Logster
39
40
  @enable_backtrace_links = true
40
41
  @gems_dir = Gem.dir + "/gems/"
41
42
  @maximum_message_length = 2000
43
+ @use_full_hostname = nil
42
44
 
43
45
  @allow_grouping = false
44
46
 
@@ -80,7 +80,10 @@ module Logster
80
80
  end
81
81
 
82
82
  def self.hostname
83
- @hostname ||= `hostname`.strip! rescue "<unknown>"
83
+ @hostname ||= begin
84
+ command = (Logster.config.use_full_hostname ? `hostname -f` : `hostname`) rescue "<unknown>"
85
+ command.strip!
86
+ end
84
87
  end
85
88
 
86
89
  def populate_from_env(env)
@@ -372,6 +372,7 @@ module Logster
372
372
  <link href='//fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>
373
373
  <link href='//fonts.googleapis.com/css?family=Roboto+Mono' rel='stylesheet' type='text/css'>
374
374
  <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=yes">
375
+ <meta name="color-scheme" content="dark light">
375
376
  #{css("vendor.css")}
376
377
  #{css("client-app.css")}
377
378
  #{script("vendor.js")}
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'json'
4
+ require 'set'
4
5
  require 'logster/base_store'
5
6
  require 'logster/redis_rate_limiter'
6
7
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Logster
4
- VERSION = "2.9.6"
4
+ VERSION = "2.10.1"
5
5
  end
data/logster.gemspec CHANGED
@@ -15,7 +15,9 @@ Gem::Specification.new do |spec|
15
15
  spec.homepage = "https://github.com/discourse/logster"
16
16
  spec.license = "MIT"
17
17
 
18
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
18
+ spec.required_ruby_version = ">= 2.5.0"
19
+
20
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
19
21
  f.start_with?("website") || f.start_with?("bin")
20
22
  end
21
23
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
@@ -33,5 +35,5 @@ Gem::Specification.new do |spec|
33
35
  spec.add_development_dependency "guard-minitest"
34
36
  spec.add_development_dependency "timecop"
35
37
  spec.add_development_dependency "byebug", "~> 11.1.0"
36
- spec.add_development_dependency "rubocop-discourse"
38
+ spec.add_development_dependency "rubocop-discourse", "~> 2.4.1"
37
39
  end
@@ -78,6 +78,18 @@ class TestMessage < MiniTest::Test
78
78
  Logster.config.application_version = nil
79
79
  end
80
80
 
81
+ def test_use_full_hostname
82
+ Logster::Message.instance_variable_set(:@hostname, nil)
83
+ Logster.config.use_full_hostname = true
84
+ msg = Logster::Message.new(0, '', 'test', 10)
85
+ msg.populate_from_env({})
86
+
87
+ assert_equal(`hostname -f`.strip!, msg.env["hostname"])
88
+ ensure
89
+ Logster.config.use_full_hostname = nil
90
+ Logster::Message.instance_variable_set(:@hostname, nil)
91
+ end
92
+
81
93
  def test_merging_sums_count_for_both_messages
82
94
  msg1 = Logster::Message.new(0, '', 'test', 10, count: 15)
83
95
  msg2 = Logster::Message.new(0, '', 'test', 20, count: 13)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logster
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.9.6
4
+ version: 2.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Saffron
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-19 00:00:00.000000000 Z
11
+ date: 2021-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -126,16 +126,16 @@ dependencies:
126
126
  name: rubocop-discourse
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ">="
129
+ - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: '0'
131
+ version: 2.4.1
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - ">="
136
+ - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: '0'
138
+ version: 2.4.1
139
139
  description: UI for viewing logs in Rack
140
140
  email:
141
141
  - sam.saffron@gmail.com
@@ -280,7 +280,7 @@ homepage: https://github.com/discourse/logster
280
280
  licenses:
281
281
  - MIT
282
282
  metadata: {}
283
- post_install_message:
283
+ post_install_message:
284
284
  rdoc_options: []
285
285
  require_paths:
286
286
  - lib
@@ -288,15 +288,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
288
288
  requirements:
289
289
  - - ">="
290
290
  - !ruby/object:Gem::Version
291
- version: '0'
291
+ version: 2.5.0
292
292
  required_rubygems_version: !ruby/object:Gem::Requirement
293
293
  requirements:
294
294
  - - ">="
295
295
  - !ruby/object:Gem::Version
296
296
  version: '0'
297
297
  requirements: []
298
- rubygems_version: 3.1.4
299
- signing_key:
298
+ rubygems_version: 3.1.6
299
+ signing_key:
300
300
  specification_version: 4
301
301
  summary: UI for viewing logs in Rack
302
302
  test_files: