journald-logger 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eaa7f70e9a09a6429c672b60ba973d4f9d545c06
4
- data.tar.gz: b01df4422dd13e47c001eddeaafe05398ded8ac7
3
+ metadata.gz: 7a6633a93054cf7ae0e79093aa7d66f6f0b4de64
4
+ data.tar.gz: 6a3f691ecd2e530522e20cd37926883ddfee4e16
5
5
  SHA512:
6
- metadata.gz: ba24c66aceca488ab25698c9db07716a5116cb1556de8d9b449f8bbd924f729941e7a09712527ff9eea2ec79dc748e4814f6b813d7172fee64089124a67480c5
7
- data.tar.gz: bbdcde2b188bb1cea50809dac1d4c4aaf563be3a9b3f15380c86845588e9d13b74d8095994ba4ffe56af7233a8251fdd4c76e19d15399adb1c5b1acee566fd04
6
+ metadata.gz: fa937e92e823a97889694c0f2c074fbc1c1ade2c2e2b84f81a3be86b302fc41ad3cc4013d775d6c2353a46abbc257547e36d934d53da2a0994db0dad21268ed2
7
+ data.tar.gz: fbe449d6afb7b74b22299eb61cacfcf4e6476d5a0b324386a2259ced9dbfcd36b1025485d69eba883334cefbfe8f2b4df111629aa1e1d7348bdfe3f53a92e662
@@ -15,7 +15,7 @@ module Journald
15
15
 
16
16
  tag_trace_location(e.backtrace_locations[0]) if bt
17
17
 
18
- send({
18
+ send(
19
19
  priority: priority,
20
20
  message: "Exception #{e.inspect}",
21
21
  gem_logger_message_type: is_cause ? 'ExceptionCause' : 'Exception',
@@ -23,7 +23,7 @@ module Journald
23
23
  exception_message: e.message,
24
24
  backtrace: bt ? e.backtrace.join("\n"): nil,
25
25
  cause: e.cause ? e.cause.inspect : nil,
26
- })
26
+ )
27
27
 
28
28
  untag_trace_location if bt
29
29
 
@@ -67,6 +67,26 @@ module Journald
67
67
  self.min_priority = severity_to_priority(severity)
68
68
  end
69
69
 
70
+ def silence(temporary_severity = nil, severity: nil, priority: nil)
71
+ prev_priority = self.min_priority
72
+
73
+ severity ||= temporary_severity
74
+
75
+ temp_priority = if priority
76
+ priority
77
+ elsif severity
78
+ severity_to_priority(severity)
79
+ else
80
+ LOG_ERR
81
+ end
82
+
83
+ self.min_priority = temp_priority
84
+
85
+ yield
86
+
87
+ self.min_priority = prev_priority
88
+ end
89
+
70
90
  alias_method :sev_threshold, :level
71
91
  alias_method :sev_threshold=, :level=
72
92
 
@@ -1,5 +1,5 @@
1
1
  module Journald
2
2
  class Logger
3
- VERSION = '2.0.0'
3
+ VERSION = '2.0.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: journald-logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Smirnov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-24 00:00:00.000000000 Z
11
+ date: 2015-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: journald-native
@@ -92,8 +92,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
92
  version: '0'
93
93
  requirements: []
94
94
  rubyforge_project:
95
- rubygems_version: 2.4.8
95
+ rubygems_version: 2.4.6
96
96
  signing_key:
97
97
  specification_version: 4
98
98
  summary: systemd-journal native logger
99
99
  test_files: []
100
+ has_rdoc: