motion-logger 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/logger/log.rb +1 -0
- data/lib/logger/version.rb +1 -1
- data/spec/log_spec.rb +9 -0
- metadata +2 -2
data/lib/logger/log.rb
CHANGED
@@ -58,6 +58,7 @@ module LoggerClassMethods
|
|
58
58
|
return unless logging?(flag)
|
59
59
|
raise ArgumentError, "flag must be one of #{FLAGS.keys}" unless FLAGS.keys.include?(flag)
|
60
60
|
async_enabled = self.async || (self.level == :error)
|
61
|
+
message = message.gsub('%', '%%')
|
61
62
|
|
62
63
|
log(async_enabled,
|
63
64
|
level:LEVELS[level],
|
data/lib/logger/version.rb
CHANGED
data/spec/log_spec.rb
CHANGED
@@ -16,6 +16,15 @@ describe "Motion::Log" do
|
|
16
16
|
Log.removeAllLoggers
|
17
17
|
end
|
18
18
|
|
19
|
+
it "should escape %@ in logs" do
|
20
|
+
Log.warn "%@"
|
21
|
+
Log.flush
|
22
|
+
|
23
|
+
file = @file_logger.logFileManager.sortedLogFilePaths.first
|
24
|
+
logs = open(file).read
|
25
|
+
logs.should.include "%@"
|
26
|
+
end
|
27
|
+
|
19
28
|
describe "FileLogger" do
|
20
29
|
it "should log with specific levels" do
|
21
30
|
Log.level = :warn
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: motion-logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-07-
|
12
|
+
date: 2012-07-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: motion-cocoapods
|