tee_logger 2.1.1 → 2.2.0

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: afd26690c0f0397edc4a12059520e2713d15f51f
4
- data.tar.gz: 0c789f266466407a56e56c04ed582357aeda1303
3
+ metadata.gz: 71e96ed7955c6a5d8f3ecbe2718ae133c86dcf57
4
+ data.tar.gz: 2a488ff3ab2b22a5515726a6b1c3b0be109bdb4b
5
5
  SHA512:
6
- metadata.gz: 62b0b3fafe4f25007fd652889162ce7753774b245e1329242c45e0d84d269436e3f40704cac2128a9ec4168a70a12373959e89c8e80b33cfd4e067e3101d88b3
7
- data.tar.gz: b4de6b8e8b8c237d2e6504ab35ef4b8b7a62cd2a01a85e8258720063eab5dd812b36eb349c322c62c2b4ff09362fd20d147a6eab1c63db96528079f926b4f6c1
6
+ metadata.gz: 54585f50bcb1fc7668548848b7278fa70c1c5207140686f55ebf982fc59b7c6e82648b7521a3afbfe8c26963f07973cf698f1e97d0a7dae95a0b3c5a4362870c
7
+ data.tar.gz: 1e3bafb69459f0df8d2da4f7e2c6f6f570dcb09b73ebd7baae193002dbff6c5fee7a66433d145f0c1f76a4f170672d6ff7e6d3ccc8badaca8391ed28d43ca287
@@ -1,3 +1,6 @@
1
+ # 2.2.0
2
+ - disabling and enabling
3
+
1
4
  # 2.1.1
2
5
  - refactoring of test case
3
6
  - Introduced capture_stdout
data/README.md CHANGED
@@ -47,11 +47,7 @@ tl.console.info('console only')
47
47
 
48
48
  # logfile only
49
49
  tl.logger.info('logger only')
50
- ```
51
-
52
- ## TODO feature
53
50
 
54
- ```
55
51
  # disable and enable console output
56
52
  tl.disable(:console)
57
53
  tl.info 'this message is logfile only'
@@ -36,14 +36,14 @@ module TeeLogger
36
36
  end
37
37
  end
38
38
 
39
- # TODO: Implement!
40
- def disable(_target)
41
- # undef_method, remove_method ....
39
+ # TODO: Too miscellaneous
40
+ def disable(target)
41
+ instance_variable_get("@#{target}").formatter = proc { |s, dt, p, m| }
42
42
  end
43
43
 
44
- # TODO: Implement!
45
- def enable(_target)
46
- # undef_method, remove_method ....
44
+ # TODO: Too miscellaneous
45
+ def enable(target)
46
+ instance_variable_get("@#{target}").formatter = Logger::Formatter.new
47
47
  end
48
48
 
49
49
  def progname
@@ -53,12 +53,14 @@ module TeeLogger
53
53
  end
54
54
 
55
55
  def progname=(name = nil)
56
- @logger.progname = name
56
+ # TODO: which?
57
+ # @logger.progname = name
57
58
  @console.progname = name
58
59
  end
59
60
 
60
61
  def formatter
61
- @logger.formatter
62
+ # TODO: which?
63
+ # @logger.formatter
62
64
  @console.formatter
63
65
  end
64
66
 
@@ -1,4 +1,4 @@
1
1
  # namespace
2
2
  module TeeLogger
3
- VERSION = '2.1.1'
3
+ VERSION = '2.2.0'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tee_logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - k-ta-yamada