tee_logger 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tee_logger/version.rb +1 -1
- data/lib/tee_logger.rb +7 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68e6895e0af9a49ee888c733815c09316e5dd412
|
4
|
+
data.tar.gz: 9c7b5ce69e3c445393f38acd60de08fca85f7549
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b23d0cb8cfa8caa9e426038b83b4d06097822a3a80715fc14c5662bfc7920cc35f80e567802649473f531ea8b2dc4d99ecd03a937d5bf257b942ccb5e7132f11
|
7
|
+
data.tar.gz: 0a96a4049b5d6232b062c1830c222b845f364caf405c6319c18caaa98a6f81dd50bffc5d76fc877ff49dcbe221db7f1a57b26611bc4999ecbce0ac408ca99700
|
data/lib/tee_logger/version.rb
CHANGED
data/lib/tee_logger.rb
CHANGED
@@ -11,11 +11,11 @@ module TeeLogger
|
|
11
11
|
@_run_once = false
|
12
12
|
def self.setup
|
13
13
|
return base_logger if @_run_once
|
14
|
+
define_singleton_methods_for_setup
|
14
15
|
|
15
16
|
yield(self) if block_given?
|
16
17
|
@_run_once = true
|
17
18
|
|
18
|
-
define_singleton_methods_for_setup
|
19
19
|
define_singleton_methods_for_logging
|
20
20
|
define_singleton_methods_for_logging_with_prefix
|
21
21
|
base_logger
|
@@ -24,24 +24,24 @@ module TeeLogger
|
|
24
24
|
class << self
|
25
25
|
private
|
26
26
|
|
27
|
-
def base_logger
|
28
|
-
@base_logger ||= Base.new(logdev, shift_age, shift_size)
|
29
|
-
end
|
30
|
-
|
31
27
|
def define_singleton_methods_for_setup
|
32
28
|
%i(logdev shift_age shift_size).each do |name|
|
33
29
|
define_singleton_method(name) do
|
34
30
|
instance_variable_get("@#{name}".to_sym)
|
35
31
|
end
|
36
|
-
private_class_method name
|
32
|
+
# private_class_method name
|
37
33
|
|
38
34
|
define_singleton_method("#{name}=") do |arg|
|
39
35
|
instance_variable_set("@#{name}".to_sym, arg)
|
40
36
|
end
|
41
|
-
private_class_method "#{name}=".to_sym
|
37
|
+
# private_class_method "#{name}=".to_sym
|
42
38
|
end
|
43
39
|
end
|
44
40
|
|
41
|
+
def base_logger
|
42
|
+
@base_logger ||= Base.new(logdev, shift_age, shift_size)
|
43
|
+
end
|
44
|
+
|
45
45
|
def define_singleton_methods_for_logging
|
46
46
|
LOGGING_METHODS.each do |name|
|
47
47
|
define_singleton_method(name) do |progname = nil, &block|
|