RubyApp 0.6.29 → 0.6.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/ruby_app/log.rb +10 -22
- data/lib/ruby_app/version.rb +1 -1
- metadata +3 -3
data/lib/ruby_app/log.rb
CHANGED
@@ -5,7 +5,6 @@ require 'facets/string/interpolate'
|
|
5
5
|
require 'fileutils'
|
6
6
|
require 'logger'
|
7
7
|
require 'socket'
|
8
|
-
require 'thread'
|
9
8
|
|
10
9
|
module RubyApp
|
11
10
|
require 'ruby_app'
|
@@ -28,7 +27,7 @@ module RubyApp
|
|
28
27
|
begin
|
29
28
|
return yield
|
30
29
|
ensure
|
31
|
-
|
30
|
+
self.log(severity, "#{message} #{Time.now - start}s")
|
32
31
|
end
|
33
32
|
end
|
34
33
|
|
@@ -38,19 +37,18 @@ module RubyApp
|
|
38
37
|
ensure
|
39
38
|
GC.start
|
40
39
|
count = ObjectSpace.each_object { |item| }
|
41
|
-
|
40
|
+
self.log(severity, "#{message} count=#{count}")
|
42
41
|
end
|
43
42
|
end
|
44
43
|
|
45
44
|
def exception(severity, exception)
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
logger.log(severity, '-' * 80)
|
45
|
+
self.log(severity, '-' * 80)
|
46
|
+
self.log(severity, "exception=#{exception.class.inspect} #{exception.message}")
|
47
|
+
self.log(severity, '-' * 80)
|
50
48
|
exception.backtrace.each do |line|
|
51
|
-
|
49
|
+
self.log(severity, line)
|
52
50
|
end
|
53
|
-
|
51
|
+
self.log(severity, '-' * 80)
|
54
52
|
end
|
55
53
|
|
56
54
|
def self.prefix(object, method)
|
@@ -58,15 +56,7 @@ module RubyApp
|
|
58
56
|
end
|
59
57
|
|
60
58
|
def self.get
|
61
|
-
RubyApp::Log.
|
62
|
-
( @@_log ||= nil ) || ( @@_standard_log ||= RubyApp::Log.new($stdout) )
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
def self.lock
|
67
|
-
( @@_lock ||= ::Mutex.new ).synchronize do
|
68
|
-
yield
|
69
|
-
end
|
59
|
+
( @@_log ||= nil ) || ( @@_standard_log ||= RubyApp::Log.new($stdout) )
|
70
60
|
end
|
71
61
|
|
72
62
|
def self.open!
|
@@ -87,10 +77,8 @@ module RubyApp
|
|
87
77
|
end
|
88
78
|
|
89
79
|
def self.reopen!
|
90
|
-
RubyApp::Log.
|
91
|
-
|
92
|
-
RubyApp::Log.open!
|
93
|
-
end
|
80
|
+
RubyApp::Log.close!
|
81
|
+
RubyApp::Log.open!
|
94
82
|
end
|
95
83
|
|
96
84
|
private
|
data/lib/ruby_app/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: RubyApp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 57
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 6
|
9
|
-
-
|
10
|
-
version: 0.6.
|
9
|
+
- 31
|
10
|
+
version: 0.6.31
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Frank G. Ficnar
|