lumberjack_syslog_device 1.1.0 → 1.1.1
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 +4 -4
- data/.github/dependabot.yml +12 -0
- data/.github/workflows/continuous_integration.yml +47 -0
- data/.github/workflows/regression_test.yml +29 -0
- data/.standard.yml +10 -0
- data/CHANGE_LOG.md +22 -2
- data/README.md +33 -4
- data/VERSION +1 -1
- data/lib/lumberjack_syslog_device.rb +10 -10
- data/lumberjack_syslog_device.gemspec +11 -10
- metadata +13 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05cda0528c884ab6d20bc8248c33a4ceaea7e03d7290597a0f38a416792298dd
|
4
|
+
data.tar.gz: 77d51847f6bedd3c998084b6d7346351f3757cb7981f8b97f06b76a053ca6c13
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 531c7966e066dd4618058306c096553cad8fd6ce36e0e40794bcaffad6ec1bee8456cf3178c456ea6b99a896a066f98a5af1406fb577a5b4123286bd2c0f92a0
|
7
|
+
data.tar.gz: 848b6bc544c0e437648e1f7b73d337f8b83790ab264cc8f8f667367a1be3c3c6d12973fc13a4834781b9976826759d80f5ea5bf9d43245ec17f9b6068c02c14b
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# Dependabot update strategy
|
2
|
+
version: 2
|
3
|
+
updates:
|
4
|
+
- package-ecosystem: bundler
|
5
|
+
directory: "/"
|
6
|
+
schedule:
|
7
|
+
interval: weekly
|
8
|
+
allow:
|
9
|
+
# Automatically keep all runtime dependencies updated
|
10
|
+
- dependency-name: "*"
|
11
|
+
dependency-type: "production"
|
12
|
+
versioning-strategy: lockfile-only
|
@@ -0,0 +1,47 @@
|
|
1
|
+
name: Continuous Integration
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- master
|
7
|
+
- actions-*
|
8
|
+
tags:
|
9
|
+
- v*
|
10
|
+
pull_request:
|
11
|
+
branches-ignore:
|
12
|
+
- actions-*
|
13
|
+
|
14
|
+
env:
|
15
|
+
BUNDLE_CLEAN: "true"
|
16
|
+
BUNDLE_PATH: vendor/bundle
|
17
|
+
BUNDLE_JOBS: 3
|
18
|
+
BUNDLE_RETRY: 3
|
19
|
+
|
20
|
+
jobs:
|
21
|
+
build:
|
22
|
+
name: ${{ matrix.ruby }} build
|
23
|
+
runs-on: ubuntu-latest
|
24
|
+
strategy:
|
25
|
+
matrix:
|
26
|
+
include:
|
27
|
+
- ruby: "ruby"
|
28
|
+
standardrb: true
|
29
|
+
- ruby: "3.0"
|
30
|
+
- ruby: "2.7"
|
31
|
+
- ruby: "2.6"
|
32
|
+
- ruby: "2.5"
|
33
|
+
- ruby: "2.4"
|
34
|
+
steps:
|
35
|
+
- uses: actions/checkout@v2
|
36
|
+
- name: Set up Ruby
|
37
|
+
uses: ruby/setup-ruby@v1
|
38
|
+
with:
|
39
|
+
ruby-version: ${{ matrix.ruby}}
|
40
|
+
- name: Install gems
|
41
|
+
run: |
|
42
|
+
bundle install
|
43
|
+
- name: Run Tests
|
44
|
+
run: bundle exec rake
|
45
|
+
- name: standardrb
|
46
|
+
if: matrix.standardrb
|
47
|
+
run: bundle exec standardrb
|
@@ -0,0 +1,29 @@
|
|
1
|
+
name: Regression Test
|
2
|
+
on:
|
3
|
+
workflow_dispatch:
|
4
|
+
schedule:
|
5
|
+
- cron: "0 15 * * 1"
|
6
|
+
env:
|
7
|
+
BUNDLE_CLEAN: "true"
|
8
|
+
BUNDLE_PATH: vendor/bundle
|
9
|
+
BUNDLE_JOBS: 3
|
10
|
+
BUNDLE_RETRY: 3
|
11
|
+
jobs:
|
12
|
+
specs:
|
13
|
+
name: Run specs
|
14
|
+
runs-on: ubuntu-latest
|
15
|
+
strategy:
|
16
|
+
fail-fast: false
|
17
|
+
steps:
|
18
|
+
- name: Checkout
|
19
|
+
uses: actions/checkout@v4
|
20
|
+
- name: Set up Ruby ${{ matrix.ruby }}
|
21
|
+
uses: ruby/setup-ruby@v1
|
22
|
+
with:
|
23
|
+
ruby-version: ruby
|
24
|
+
- name: Install bundler
|
25
|
+
run: |
|
26
|
+
bundle update
|
27
|
+
- name: Run specs
|
28
|
+
run: |
|
29
|
+
bundle exec rake spec
|
data/.standard.yml
ADDED
data/CHANGE_LOG.md
CHANGED
@@ -1,3 +1,23 @@
|
|
1
|
-
#
|
1
|
+
# Changelog
|
2
|
+
All notable changes to this project will be documented in this file.
|
2
3
|
|
3
|
-
|
4
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
|
+
|
7
|
+
## 1.1.1
|
8
|
+
|
9
|
+
### Changed
|
10
|
+
|
11
|
+
- Always cast values to strings before logging to syslog (thanks @eremeyev).
|
12
|
+
|
13
|
+
## 1.1.0
|
14
|
+
|
15
|
+
### Added
|
16
|
+
|
17
|
+
- Add support for lumberjack 2.0 tags.
|
18
|
+
|
19
|
+
## 1.0.0
|
20
|
+
|
21
|
+
### Added
|
22
|
+
|
23
|
+
- Initial release.
|
data/README.md
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
# Lumberjack Syslog Device
|
2
2
|
|
3
|
-
[](https://github.com/bdurand/lumberjack_syslog_device/actions/workflows/continuous_integration.yml)
|
4
|
+
[](https://github.com/bdurand/lumberjack_syslog_device/actions/workflows/regression_test.yml)
|
5
|
+
[](https://github.com/testdouble/standard)
|
5
6
|
|
6
7
|
This gem provides a logging device for the [lumberjack](https://github.com/bdurand/lumberjack) gem that will log to syslog, the centralized system logging facility. See http://en.wikipedia.org/wiki/Syslog for more information on syslog.
|
7
8
|
|
8
|
-
##
|
9
|
+
## Usage
|
9
10
|
|
10
11
|
```ruby
|
11
12
|
require 'lumberjack_syslog_device'
|
@@ -15,4 +16,32 @@ logger = Lumberjack::Logger.new(device)
|
|
15
16
|
logger.info("Write me to syslog!")
|
16
17
|
```
|
17
18
|
|
18
|
-
See SyslogDevice for more details.
|
19
|
+
See the docs in the Lumberjack::SyslogDevice file for more details.
|
20
|
+
|
21
|
+
## Installation
|
22
|
+
|
23
|
+
Add this line to your application's Gemfile:
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
gem 'lumberjack_syslog_device'
|
27
|
+
```
|
28
|
+
|
29
|
+
And then execute:
|
30
|
+
```bash
|
31
|
+
$ bundle
|
32
|
+
```
|
33
|
+
|
34
|
+
Or install it yourself as:
|
35
|
+
```bash
|
36
|
+
$ gem install lumberjack_syslog_device
|
37
|
+
```
|
38
|
+
|
39
|
+
## Contributing
|
40
|
+
|
41
|
+
Open a pull request on GitHub.
|
42
|
+
|
43
|
+
Please use the [standardrb](https://github.com/testdouble/standard) syntax and lint your code with `standardrb --fix` before submitting.
|
44
|
+
|
45
|
+
## License
|
46
|
+
|
47
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.1
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require "syslog"
|
4
|
+
require "lumberjack"
|
5
5
|
|
6
6
|
module Lumberjack
|
7
7
|
# This Lumberjack device logs output to syslog. There can only be one connection to syslog
|
@@ -18,8 +18,8 @@ module Lumberjack
|
|
18
18
|
Severity::UNKNOWN => Syslog::LOG_ALERT
|
19
19
|
}
|
20
20
|
|
21
|
-
PERCENT =
|
22
|
-
ESCAPED_PERCENT =
|
21
|
+
PERCENT = "%"
|
22
|
+
ESCAPED_PERCENT = "%%"
|
23
23
|
|
24
24
|
@@lock = Mutex.new
|
25
25
|
|
@@ -68,7 +68,7 @@ module Lumberjack
|
|
68
68
|
end
|
69
69
|
|
70
70
|
def write(entry)
|
71
|
-
message = @template.call(entry).gsub(PERCENT, ESCAPED_PERCENT)
|
71
|
+
message = @template.call(entry).to_s.gsub(PERCENT, ESCAPED_PERCENT)
|
72
72
|
@@lock.synchronize do
|
73
73
|
syslog = open_syslog(entry.progname)
|
74
74
|
begin
|
@@ -82,7 +82,7 @@ module Lumberjack
|
|
82
82
|
def close
|
83
83
|
flush
|
84
84
|
@lock.synchronize do
|
85
|
-
@syslog.close if @syslog
|
85
|
+
@syslog.close if @syslog&.opened?
|
86
86
|
end
|
87
87
|
end
|
88
88
|
|
@@ -90,22 +90,22 @@ module Lumberjack
|
|
90
90
|
|
91
91
|
# Open syslog with ident set to progname. If it is already open with a different
|
92
92
|
# ident, close it and reopen it.
|
93
|
-
def open_syslog(progname)
|
93
|
+
def open_syslog(progname) # :nodoc:
|
94
94
|
syslog_impl = syslog_implementation
|
95
95
|
if syslog_impl.opened?
|
96
|
-
if (progname.nil? || syslog_impl.ident == progname) && @syslog_facility == syslog_impl.facility && @syslog_options == syslog_impl.options
|
96
|
+
if (progname.nil? || syslog_impl.ident == progname.to_s) && @syslog_facility == syslog_impl.facility && @syslog_options == syslog_impl.options
|
97
97
|
return syslog_impl
|
98
98
|
else
|
99
99
|
syslog_impl.close
|
100
100
|
end
|
101
101
|
end
|
102
|
-
syslog = syslog_impl.open(progname, @syslog_options, @syslog_facility)
|
102
|
+
syslog = syslog_impl.open(progname.to_s, @syslog_options, @syslog_facility)
|
103
103
|
syslog.mask = Syslog::LOG_UPTO(Syslog::LOG_DEBUG)
|
104
104
|
syslog
|
105
105
|
end
|
106
106
|
|
107
107
|
# Provided for testing purposes
|
108
|
-
def syslog_implementation
|
108
|
+
def syslog_implementation # :nodoc:
|
109
109
|
Syslog
|
110
110
|
end
|
111
111
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
|
-
spec.name =
|
2
|
+
spec.name = "lumberjack_syslog_device"
|
3
3
|
spec.version = File.read(File.expand_path("../VERSION", __FILE__)).strip
|
4
|
-
spec.authors = [
|
5
|
-
spec.email = [
|
4
|
+
spec.authors = ["Brian Durand"]
|
5
|
+
spec.email = ["bbdurand@gmail.com"]
|
6
6
|
|
7
7
|
spec.summary = "A logging device for the lumberjack gem that writes log entries to syslog."
|
8
8
|
spec.homepage = "https://github.com/bdurand/lumberjack_syslog_device"
|
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
|
11
11
|
# Specify which files should be added to the gem when it is released.
|
12
12
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
13
|
-
ignore_files = %w
|
13
|
+
ignore_files = %w[
|
14
14
|
.gitignore
|
15
15
|
.travis.yml
|
16
16
|
Appraisals
|
@@ -19,15 +19,16 @@ Gem::Specification.new do |spec|
|
|
19
19
|
Rakefile
|
20
20
|
gemfiles/
|
21
21
|
spec/
|
22
|
-
|
23
|
-
spec.files = Dir.chdir(File.expand_path(
|
24
|
-
`git ls-files -z`.split("\x0").reject{ |f| ignore_files.any?{ |path| f.start_with?(path) } }
|
22
|
+
]
|
23
|
+
spec.files = Dir.chdir(File.expand_path("..", __FILE__)) do
|
24
|
+
`git ls-files -z`.split("\x0").reject { |f| ignore_files.any? { |path| f.start_with?(path) } }
|
25
25
|
end
|
26
26
|
|
27
|
-
spec.require_paths = [
|
27
|
+
spec.require_paths = ["lib"]
|
28
|
+
|
29
|
+
spec.required_ruby_version = ">=2.4"
|
28
30
|
|
29
31
|
spec.add_dependency "lumberjack", ">=1.1"
|
30
32
|
|
31
|
-
spec.add_development_dependency
|
32
|
-
spec.add_development_dependency "rake"
|
33
|
+
spec.add_development_dependency "bundler"
|
33
34
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lumberjack_syslog_device
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Durand
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lumberjack
|
@@ -25,21 +25,7 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '3.0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '3.0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rake
|
28
|
+
name: bundler
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
44
30
|
requirements:
|
45
31
|
- - ">="
|
@@ -52,13 +38,17 @@ dependencies:
|
|
52
38
|
- - ">="
|
53
39
|
- !ruby/object:Gem::Version
|
54
40
|
version: '0'
|
55
|
-
description:
|
41
|
+
description:
|
56
42
|
email:
|
57
43
|
- bbdurand@gmail.com
|
58
44
|
executables: []
|
59
45
|
extensions: []
|
60
46
|
extra_rdoc_files: []
|
61
47
|
files:
|
48
|
+
- ".github/dependabot.yml"
|
49
|
+
- ".github/workflows/continuous_integration.yml"
|
50
|
+
- ".github/workflows/regression_test.yml"
|
51
|
+
- ".standard.yml"
|
62
52
|
- CHANGE_LOG.md
|
63
53
|
- MIT_LICENSE
|
64
54
|
- README.md
|
@@ -69,7 +59,7 @@ homepage: https://github.com/bdurand/lumberjack_syslog_device
|
|
69
59
|
licenses:
|
70
60
|
- MIT
|
71
61
|
metadata: {}
|
72
|
-
post_install_message:
|
62
|
+
post_install_message:
|
73
63
|
rdoc_options: []
|
74
64
|
require_paths:
|
75
65
|
- lib
|
@@ -77,15 +67,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
77
67
|
requirements:
|
78
68
|
- - ">="
|
79
69
|
- !ruby/object:Gem::Version
|
80
|
-
version: '
|
70
|
+
version: '2.4'
|
81
71
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
82
72
|
requirements:
|
83
73
|
- - ">="
|
84
74
|
- !ruby/object:Gem::Version
|
85
75
|
version: '0'
|
86
76
|
requirements: []
|
87
|
-
rubygems_version: 3.
|
88
|
-
signing_key:
|
77
|
+
rubygems_version: 3.4.12
|
78
|
+
signing_key:
|
89
79
|
specification_version: 4
|
90
80
|
summary: A logging device for the lumberjack gem that writes log entries to syslog.
|
91
81
|
test_files: []
|