sbsm 1.3.8 → 1.3.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.txt +4 -0
- data/lib/sbsm/logger.rb +8 -0
- data/lib/sbsm/version.rb +1 -1
- data/test/test_logger.rb +22 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd930d80bc37cb035451c6cd60025c07d93ecdd4
|
4
|
+
data.tar.gz: a885ac42d48f711ed8d66a51d4a3d54032b0571b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 698df6a49ae0bb42eb7a11bba5b0277a35c29f17e1cfa396a61c1a08c4d047edeec0cbe5f3f10f2099b42c9c5262db5bb13dd8cd8b2bf044746668e665dd9bb8
|
7
|
+
data.tar.gz: c5c8f01a38aeb00a104af5998bbc0ef0a48693461a5b404379fa67959d66dd16d9d2dd2fe8cfbffadcb04861e0c0778dde848155168a01ff250fa0bd89301926
|
data/History.txt
CHANGED
data/lib/sbsm/logger.rb
CHANGED
@@ -38,6 +38,14 @@ module SBSM
|
|
38
38
|
info = "#{File.basename(caller[0])} #{msg}"
|
39
39
|
@@logger.info(info) if @@logger
|
40
40
|
end
|
41
|
+
def self.error(msg)
|
42
|
+
info = "#{File.basename(caller[0])} #{msg}"
|
43
|
+
@@logger.error(info) if @@logger
|
44
|
+
end
|
45
|
+
def self.warn(msg)
|
46
|
+
info = "#{File.basename(caller[0])} #{msg}"
|
47
|
+
@@logger.warn(info) if @@logger
|
48
|
+
end
|
41
49
|
def self.debug(msg)
|
42
50
|
info = "#{File.basename(caller[0])} #{msg}"
|
43
51
|
@@logger.debug(info) if @@logger
|
data/lib/sbsm/version.rb
CHANGED
data/test/test_logger.rb
CHANGED
@@ -22,7 +22,7 @@
|
|
22
22
|
# ywesee - intellectual capital connected, Winterthurerstrasse 52, CH-8006 Zürich, Switzerland
|
23
23
|
# hwyss@ywesee.com
|
24
24
|
#
|
25
|
-
# TestSession -- sbsm -- 22.10.2002 -- hwyss@ywesee.com
|
25
|
+
# TestSession -- sbsm -- 22.10.2002 -- hwyss@ywesee.com
|
26
26
|
#++
|
27
27
|
|
28
28
|
require 'minitest/autorun'
|
@@ -48,7 +48,7 @@ class TestLogger < Minitest::Test
|
|
48
48
|
@temp_file.unlink
|
49
49
|
end
|
50
50
|
|
51
|
-
def
|
51
|
+
def test_default_levels_with_no_logging
|
52
52
|
saved_length = File.size(@default_name)
|
53
53
|
SBSM.debug("debug #{__LINE__}")
|
54
54
|
assert_equal(saved_length, File.size(@default_name))
|
@@ -101,4 +101,23 @@ class TestLogger < Minitest::Test
|
|
101
101
|
assert_equal(default_saved_length, File.size(@default_name))
|
102
102
|
end
|
103
103
|
|
104
|
-
|
104
|
+
def test_warn
|
105
|
+
SBSM.logger = Logger.new(@temp_file.path)
|
106
|
+
saved_length = File.size(@temp_file.path)
|
107
|
+
assert( !/test_warn/.match(IO.read(@temp_file.path)))
|
108
|
+
SBSM.warn("xx #{__LINE__}")
|
109
|
+
assert(saved_length < File.size(@temp_file.path))
|
110
|
+
content = IO.read(@temp_file.path)
|
111
|
+
assert_match(/test_warn/, IO.read(@temp_file.path))
|
112
|
+
end
|
113
|
+
|
114
|
+
def test_error
|
115
|
+
SBSM.logger = Logger.new(@temp_file.path)
|
116
|
+
saved_length = File.size(@temp_file.path)
|
117
|
+
assert( !/test_error/.match(IO.read(@temp_file.path)))
|
118
|
+
SBSM.error("xx #{__LINE__}")
|
119
|
+
assert(saved_length < File.size(@temp_file.path))
|
120
|
+
assert_match(/test_error/, IO.read(@temp_file.path))
|
121
|
+
end
|
122
|
+
|
123
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sbsm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masaomi Hatakeyama, Zeno R.R. Davatz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|