tee_logger 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/Rakefile +3 -3
- data/lib/tee_logger/version.rb +1 -1
- data/lib/tee_logger.rb +14 -3
- data/tee_logger.gemspec +3 -0
- metadata +30 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: afd26690c0f0397edc4a12059520e2713d15f51f
|
4
|
+
data.tar.gz: 0c789f266466407a56e56c04ed582357aeda1303
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 62b0b3fafe4f25007fd652889162ce7753774b245e1329242c45e0d84d269436e3f40704cac2128a9ec4168a70a12373959e89c8e80b33cfd4e067e3101d88b3
|
7
|
+
data.tar.gz: b4de6b8e8b8c237d2e6504ab35ef4b8b7a62cd2a01a85e8258720063eab5dd812b36eb349c322c62c2b4ff09362fd20d147a6eab1c63db96528079f926b4f6c1
|
data/CHANGELOG.md
CHANGED
data/Rakefile
CHANGED
data/lib/tee_logger/version.rb
CHANGED
data/lib/tee_logger.rb
CHANGED
@@ -10,12 +10,13 @@ module TeeLogger
|
|
10
10
|
TeeLogger.new(logdev, shift_age, shift_size)
|
11
11
|
end
|
12
12
|
|
13
|
+
# main
|
13
14
|
class TeeLogger
|
14
15
|
attr_reader :logger, :console
|
15
16
|
|
16
17
|
def initialize(logdev = DEFAULT_FILE, shift_age = 0, shift_size = 1_048_576)
|
17
18
|
@logger = Logger.new(logdev, shift_age, shift_size)
|
18
|
-
@console = Logger.new(
|
19
|
+
@console = Logger.new($stdout)
|
19
20
|
end
|
20
21
|
|
21
22
|
# logging methods.
|
@@ -36,12 +37,12 @@ module TeeLogger
|
|
36
37
|
end
|
37
38
|
|
38
39
|
# TODO: Implement!
|
39
|
-
def disable(
|
40
|
+
def disable(_target)
|
40
41
|
# undef_method, remove_method ....
|
41
42
|
end
|
42
43
|
|
43
44
|
# TODO: Implement!
|
44
|
-
def enable(
|
45
|
+
def enable(_target)
|
45
46
|
# undef_method, remove_method ....
|
46
47
|
end
|
47
48
|
|
@@ -56,6 +57,16 @@ module TeeLogger
|
|
56
57
|
@console.progname = name
|
57
58
|
end
|
58
59
|
|
60
|
+
def formatter
|
61
|
+
@logger.formatter
|
62
|
+
@console.formatter
|
63
|
+
end
|
64
|
+
|
65
|
+
def formatter=(formatter)
|
66
|
+
@logger.formatter = formatter
|
67
|
+
@console.formatter = formatter
|
68
|
+
end
|
69
|
+
|
59
70
|
# def close
|
60
71
|
# @logger.close
|
61
72
|
# # @console.close
|
data/tee_logger.gemspec
CHANGED
@@ -27,4 +27,7 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.add_development_dependency 'pry-doc'
|
28
28
|
spec.add_development_dependency 'pry-theme'
|
29
29
|
spec.add_development_dependency 'rubocop'
|
30
|
+
|
31
|
+
spec.add_development_dependency 'capture_stdout'
|
32
|
+
spec.add_development_dependency 'fakefs'
|
30
33
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tee_logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- k-ta-yamada
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -108,6 +108,34 @@ dependencies:
|
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: capture_stdout
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: fakefs
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
111
139
|
description: logging to file and standard output
|
112
140
|
email:
|
113
141
|
- key.luvless@gmail.com
|