logster 2.9.6 → 2.9.7

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: 2f7af959f601d0015cd062cf6303134c05101c70dee6050665dd7c812b04e5fb
4
- data.tar.gz: 3a0439891b28bb2ddca56b286d0cb5ea8dcbcc37144040fe9d83a850a32b78dd
3
+ metadata.gz: 057b84d003670451a106018f1a460150f20a92059f4b50e25db59774459f8a7b
4
+ data.tar.gz: 19ddbb573c579a965ef5fab006b56b5fd9139f37382df7f2990a95522eb041c6
5
5
  SHA512:
6
- metadata.gz: 0dee60ef65432e8f5deb7b39585a6574384189a3ead8177211b62821edb12dd7fd9eef1fd9cc3c1ca3e568115921b75c9aca9afe1e83f76c197d11a38626b8d0
7
- data.tar.gz: f5631b96c324874ca987e5c783d474e20e4225df7b9f9988bb8922418dba9e37bb3c03c7ec224a777fdb4370963fc2dd7039a13e4c9a0aafc19fd3adebddcbf2
6
+ metadata.gz: d8bb2c8e2f217daeb13ab0bc94fd6cc047c13c65d2e9fc4af7ae0593ebdf63d035b333defcb00e989c80c4d0869cdb2373efe0ceceaa9c6906f2535a139b143d
7
+ data.tar.gz: 0e70666cc37cc8f1628bd778f5697a6ab0f2d9337f4ce33e0c46a558a6c039f032ea709127ed74860ff3ebfac06c1cd0dbe2fa0d6d82897620767b4ad88266d8
@@ -1,54 +1,49 @@
1
- name: Logster Tests
1
+ name: CI
2
2
 
3
3
  on:
4
+ pull_request:
4
5
  push:
5
6
  branches:
6
7
  - master
7
- pull_request:
8
+ - main
8
9
 
9
10
  jobs:
10
- ruby:
11
+ build:
11
12
  runs-on: ubuntu-latest
12
- name: Ruby ${{ matrix.ruby }}
13
+
14
+ services:
15
+ redis:
16
+ image: redis
17
+ ports:
18
+ - 6379:6379
19
+
13
20
  strategy:
14
21
  matrix:
15
- ruby: ["2.7", "2.6", "2.5"]
16
- redis: ["4.x"]
22
+ ruby:
23
+ - 2.5
24
+ - 2.6
25
+ - 2.7
26
+ - 3.0
27
+
17
28
  steps:
18
29
  - uses: actions/checkout@v2
19
- - uses: actions/setup-ruby@v1
30
+
31
+ - name: Setup ruby
32
+ uses: ruby/setup-ruby@v1
20
33
  with:
21
34
  ruby-version: ${{ matrix.ruby }}
22
- - uses: shogo82148/actions-setup-redis@v1
23
- with:
24
- redis-version: ${{ matrix.redis }}
25
- - name: Bundler cache
26
- uses: actions/cache@v2
27
- with:
28
- path: vendor/bundle
29
- key: ${{ runner.os }}-${{ matrix.ruby }}-gems-${{ hashFiles('**/Gemfile.lock') }}
30
- restore-keys: |
31
- ${{ runner.os }}-${{ matrix.ruby }}-gems-
32
- - name: Setup gems
33
- run: |
34
- gem install bundler
35
- bundle config path vendor/bundle
36
- bundle install --jobs 4
37
- - name: Rubocop
35
+ bundler-cache: true
36
+
37
+ - name: Lint
38
38
  run: bundle exec rubocop
39
+
39
40
  - name: Tests
40
41
  run: bundle exec rake test
41
- js:
42
- runs-on: ubuntu-latest
43
- name: JavaScript Lint
44
- defaults:
45
- run:
46
- working-directory: client-app
47
- steps:
48
- - uses: actions/checkout@v2
42
+
49
43
  - name: Get yarn cache directory
50
44
  id: yarn-cache-dir
51
45
  run: echo "::set-output name=dir::$(yarn cache dir)"
46
+
52
47
  - name: Yarn cache
53
48
  uses: actions/cache@v2
54
49
  id: yarn-cache
@@ -57,7 +52,24 @@ jobs:
57
52
  key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
58
53
  restore-keys: |
59
54
  ${{ runner.os }}-yarn-
55
+
60
56
  - name: Yarn install
61
- run: yarn install
57
+ run: cd client-app && yarn install
58
+
62
59
  - name: ESLint
63
- run: yarn eslint .
60
+ run: cd client-app && yarn eslint .
61
+
62
+ publish:
63
+ if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')
64
+ needs: build
65
+ runs-on: ubuntu-latest
66
+
67
+ steps:
68
+ - uses: actions/checkout@v2
69
+
70
+ - name: Release Gem
71
+ uses: discourse/publish-rubygems-action@v2-beta
72
+ env:
73
+ RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
74
+ GIT_EMAIL: team@discourse.org
75
+ GIT_NAME: discoursebot
data/.gitignore CHANGED
@@ -1,21 +1 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .yardoc
6
1
  Gemfile.lock
7
- InstalledFiles
8
- _yardoc
9
- coverage
10
- doc/
11
- lib/bundler/man
12
- pkg
13
- rdoc
14
- spec/reports
15
- test/tmp
16
- test/version_tmp
17
- tmp
18
- .byebug_history
19
- .rubocop-https---raw-githubusercontent-com-discourse-discourse-master--rubocop-yml
20
- *.swo
21
- *.swp
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ - 2021-07-01: 2.9.7
4
+
5
+ - FEATURE: Optionally use full hostname
6
+
3
7
  - 2021-02-19: 2.9.6
4
8
 
5
9
  - UX: Make `Warn` level visible by default
@@ -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,8 @@ module Logster
80
80
  end
81
81
 
82
82
  def self.hostname
83
- @hostname ||= `hostname`.strip! rescue "<unknown>"
83
+ command = Logster.config.use_full_hostname ? `hostname -f` : `hostname`
84
+ @hostname ||= command.strip! rescue "<unknown>"
84
85
  end
85
86
 
86
87
  def populate_from_env(env)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Logster
4
- VERSION = "2.9.6"
4
+ VERSION = "2.9.7"
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.9.7
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-07-02 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,7 +288,7 @@ 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
  - - ">="
@@ -296,7 +296,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
296
296
  version: '0'
297
297
  requirements: []
298
298
  rubygems_version: 3.1.4
299
- signing_key:
299
+ signing_key:
300
300
  specification_version: 4
301
301
  summary: UI for viewing logs in Rack
302
302
  test_files: