tee_logger 3.0.1 → 3.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/tee_logger.rb +2 -6
- data/lib/tee_logger/constants.rb +18 -0
- data/lib/tee_logger/utils.rb +1 -12
- data/lib/tee_logger/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c79949078c49a4d284fbc91a1d9f95096ca7d84
|
4
|
+
data.tar.gz: 353081f242f08a788ce77aeffec40b6eddb6c5b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56e5b76c2bc1b6eff02d16997c04f19b38b15db1cc0675e80ce82162703224603d6de63ade285d587c9477d4e93791661c13d9219657479aad57bf55fb17c55a
|
7
|
+
data.tar.gz: 2ac56759895edff78e7f274cbe5126986dc5f8b14a22c777bca51e22c1c7d7acace9432ae8a5e083369dd8233c0f162802e2cec5fa1e6da2a08eee7b00dc427f
|
data/CHANGELOG.md
CHANGED
data/lib/tee_logger.rb
CHANGED
@@ -1,14 +1,10 @@
|
|
1
|
-
require 'tee_logger/utils'
|
2
1
|
require 'tee_logger/version'
|
2
|
+
require 'tee_logger/constants'
|
3
|
+
require 'tee_logger/utils'
|
3
4
|
require 'logger'
|
4
5
|
|
5
6
|
# namespace
|
6
7
|
module TeeLogger
|
7
|
-
# no param of filename, set this filename
|
8
|
-
DEFAULT_FILE = './tee_logger.log'
|
9
|
-
# Implements targets
|
10
|
-
LOGGING_METHODS = [:debug, :info, :warn, :error, :fatal].freeze
|
11
|
-
|
12
8
|
# shortcut for TeeLogger::TeeLogger.new
|
13
9
|
# @see TeeLogger
|
14
10
|
def self.new(logdev = DEFAULT_FILE, shift_age = 0, shift_size = 1_048_576)
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# namespace
|
2
|
+
module TeeLogger
|
3
|
+
# no param of filename, set this filename
|
4
|
+
DEFAULT_FILE = './tee_logger.log'
|
5
|
+
# Implements targets
|
6
|
+
LOGGING_METHODS = [:debug, :info, :warn, :error, :fatal]
|
7
|
+
# defined logdev names
|
8
|
+
LOGDEV_NAMES = [:console, :logfile]
|
9
|
+
# defined paired of logdev name
|
10
|
+
LOGDEV_REVERSE = { console: :logfile, logfile: :console }
|
11
|
+
|
12
|
+
# using private method #parse_to_hash
|
13
|
+
ParsedOption = Struct.new(:logdev_name, :indent_level)
|
14
|
+
# LOGDEV_NAMES not incuded error
|
15
|
+
class IncorrectNameError < StandardError; end
|
16
|
+
# option's class is not allow
|
17
|
+
class IncorrectOptionError < StandardError; end
|
18
|
+
end
|
data/lib/tee_logger/utils.rb
CHANGED
@@ -2,18 +2,7 @@
|
|
2
2
|
module TeeLogger
|
3
3
|
# util
|
4
4
|
module Utils
|
5
|
-
|
6
|
-
class IncorrectNameError < StandardError; end
|
7
|
-
#
|
8
|
-
class IncorrectOptionError < StandardError; end
|
9
|
-
# using private method #parse_to_hash
|
10
|
-
ParsedOption = Struct.new(:logdev_name, :indent_level)
|
11
|
-
# defined log devices names
|
12
|
-
LOGDEV_NAMES = [:console, :logfile]
|
13
|
-
# defined reverse names
|
14
|
-
LOGDEV_REVERSE = { console: :logfile, logfile: :console }
|
15
|
-
|
16
|
-
private
|
5
|
+
module_function
|
17
6
|
|
18
7
|
def extract_options(options)
|
19
8
|
options.each_with_object(ParsedOption.new(nil, 0)) do |val, obj|
|
data/lib/tee_logger/version.rb
CHANGED
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: 3.0.
|
4
|
+
version: 3.0.2
|
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-10-
|
11
|
+
date: 2015-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -181,6 +181,7 @@ files:
|
|
181
181
|
- README.md
|
182
182
|
- Rakefile
|
183
183
|
- lib/tee_logger.rb
|
184
|
+
- lib/tee_logger/constants.rb
|
184
185
|
- lib/tee_logger/utils.rb
|
185
186
|
- lib/tee_logger/version.rb
|
186
187
|
- tee_logger.gemspec
|