semantic_logger 4.8.1 → 4.8.2

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
  SHA256:
3
- metadata.gz: c969376e41c290b01fd22a111b1eca500ab4a01e80e13d4fbf18b800b9c50c9e
4
- data.tar.gz: 4319e88ebd250dd524add711cd16508d8f825686cfa28731f19d52c35854d738
3
+ metadata.gz: d0bd2e2a218bdbf0bfa67ca85da999b352de9b214383890278c0710cd3f84e91
4
+ data.tar.gz: dd3b393e8f0a031ddb25c2ca3cdeaa7d761617586f366006e79d7fcf3de8a9a5
5
5
  SHA512:
6
- metadata.gz: 435ada2480d22e98e3e4467086167411f0620f9a0fd4d9210bb715c7a7ef3defe08986afaf8b174aeb55a5bde8ba46dfefea1c8d693c78623495755d2a41c6e2
7
- data.tar.gz: bb2a64552713ae4fcb3b3ae59133e4a5241ecb4692ddc7304e77f72bc76ef47e219cfd481dbebd482385e7b53e161d15b245b644c01030e9cb021c65ec222d0a
6
+ metadata.gz: dba969cf8d70cbb63a6542a692b68773f395eda22515267c572630aa5180a3bbfe490f2096e83cc366f06e86bbf06bafc87d2e5800810110107ac5080b7a1046
7
+ data.tar.gz: 35d69548ee2a91fb4d7c0575ea2d1da48648a7352d52304e8f270a6fe095c42e7ad1367594cef0b14941e14fc47906816df2360899c37fc577828b368c71c21a
@@ -62,9 +62,14 @@ module SemanticLogger
62
62
  def initialize(io: nil, file_name: nil, **args, &block)
63
63
  if io
64
64
  @log = io
65
+ unless @log.respond_to?(:write)
66
+ raise(ArgumentError, "SemanticLogging::Appender::File :io is not a valid IO instance: #{io.inspect}")
67
+ end
65
68
  else
66
69
  @file_name = file_name
67
- raise "SemanticLogging::Appender::File missing mandatory parameter :file_name or :io" unless file_name
70
+ unless file_name
71
+ raise(ArgumentError, "SemanticLogging::Appender::File missing mandatory parameter :file_name or :io")
72
+ end
68
73
 
69
74
  reopen
70
75
  end
@@ -32,7 +32,14 @@ module SemanticLogger
32
32
  module Loggable
33
33
  def self.included(base)
34
34
  base.extend ClassMethods
35
+ base.singleton_class.class_eval do
36
+ undef_method :logger if method_defined?(:logger)
37
+ undef_method :logger= if method_defined?(:logger=)
38
+ end
35
39
  base.class_eval do
40
+ undef_method :logger if method_defined?(:logger)
41
+ undef_method :logger= if method_defined?(:logger=)
42
+
36
43
  # Returns [SemanticLogger::Logger] class level logger
37
44
  def self.logger
38
45
  @semantic_logger ||= SemanticLogger[self]
@@ -1,3 +1,3 @@
1
1
  module SemanticLogger
2
- VERSION = "4.8.1".freeze
2
+ VERSION = "4.8.2".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: semantic_logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.8.1
4
+ version: 4.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Reid Morrison
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-28 00:00:00.000000000 Z
11
+ date: 2021-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby