logrb 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/logrb.rb +10 -1
  3. data/lib/logrb/version.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d2b3538c59ff3cd6964b1322b178ff41acd4a61f9cba41eb32f57433d9ccafa3
4
- data.tar.gz: '0240916d10cc49d29214015d73d729eff14c72829212b86e57f17ea10be4395d'
3
+ metadata.gz: 0b5d74be8b8ba51716b2ac26aa49012a07cb7a89f294ed9d94603ecf1c5b1e66
4
+ data.tar.gz: 12ddcbf56cfdb6fd89c5476e04914be8aa5bb6dc3061a44cf7abbc3ff4fee454
5
5
  SHA512:
6
- metadata.gz: c552d0a05a75e68885c9a401d17350cabc4a7257e8bf0016083567fa59992a243764ae017daddeaa9b5312f59e40726fb5742223ea67b058bb935454458a486e
7
- data.tar.gz: 6c28c536a1afdd1eda0395ed6683127633e8d6701a39fb73294bc4a342aff5dc857f08c332aac0339a2e68d386e86d07d57ec76b04a083d2e18fa8f15c1c57b2
6
+ metadata.gz: a7f6030eb6a5fd71803f7076820751f1e6bb63b4e4669fae1d0aa0f235f8200e9468784abced5818e30f061cc04c9e9ccc251e7d7ae9e9691605020017b2df87
7
+ data.tar.gz: 21ee4e2c74e70fb53591ce7d1ad73c1f335a6d3b4d4e2c2c9537ef49b4bf1c7c9e82743cee1b85ec025d39e5c1936d38f59736264a6c63b14d95caef3b4cf02e
data/lib/logrb.rb CHANGED
@@ -88,7 +88,7 @@ class Logrb
88
88
  inst
89
89
  end
90
90
 
91
- LEVELS.except(:error).each_key do |name|
91
+ LEVELS.except(:error, :fatal).each_key do |name|
92
92
  define_method(name) do |msg, **fields|
93
93
  return if LEVELS[@level] > LEVELS[name]
94
94
 
@@ -106,6 +106,15 @@ class Logrb
106
106
  nil
107
107
  end
108
108
 
109
+ # Public: Emits a fatal message to the log output, and invokes Kernel#exit
110
+ # with a non-zero status code. When error is provided, this method attempts
111
+ # to gather a stacktrace to include in the emitted entry. This log entry
112
+ # cannot be filtered, and is always emitted.
113
+ def fatal(msg, error = nil, **fields)
114
+ wrap(:fatal, msg, error, fields)
115
+ exit 1
116
+ end
117
+
109
118
  # Public: Dumps a given String or Array in the same format as `hexdump -C`.
110
119
  def dump(log, data = nil, **fields)
111
120
  return if LEVELS[@level] > LEVELS[:debug]
data/lib/logrb/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Logrb
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logrb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Gama
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-08-16 00:00:00.000000000 Z
11
+ date: 2021-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hexdump