semantic_logger 0.3.1 → 0.3.2
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/FUTURE.rb +6 -0
- data/lib/semantic_logger/appender/logger.rb +1 -1
- data/lib/semantic_logger/railtie.rb +6 -2
- data/lib/semantic_logger/version.rb +1 -1
- metadata +3 -4
- data/lib/semantic_logger/rails.rb +0 -48
data/FUTURE.rb
CHANGED
@@ -56,12 +56,16 @@ module SemanticLogger #:nodoc:
|
|
56
56
|
|
57
57
|
# Replace the default Rails loggers
|
58
58
|
Rails.logger = config.logger = SemanticLogger::Logger.new(Rails)
|
59
|
-
if defined?(ActiveRecord)
|
59
|
+
if defined?(ActiveRecord::Base)
|
60
60
|
ActiveRecord::Base.logger = SemanticLogger::Logger.new(ActiveRecord)
|
61
61
|
end
|
62
|
-
if defined?(ActionController)
|
62
|
+
if defined?(ActionController::Base)
|
63
63
|
ActionController::Base.logger = SemanticLogger::Logger.new(ActionController)
|
64
64
|
end
|
65
|
+
if defined?(ActiveResource::Base)
|
66
|
+
ActiveResource::Base.logger = SemanticLogger::Logger.new(ActiveResource)
|
67
|
+
end
|
68
|
+
|
65
69
|
SemanticLogger::Logger.logger.info "SemanticLogger initialized"
|
66
70
|
end
|
67
71
|
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 3
|
8
|
-
-
|
9
|
-
version: 0.3.
|
8
|
+
- 2
|
9
|
+
version: 0.3.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Reid Morrison
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2012-08-
|
17
|
+
date: 2012-08-30 00:00:00 -04:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -44,7 +44,6 @@ files:
|
|
44
44
|
- lib/semantic_logger/appender/logger.rb
|
45
45
|
- lib/semantic_logger/appender/mongodb.rb
|
46
46
|
- lib/semantic_logger/logger.rb
|
47
|
-
- lib/semantic_logger/rails.rb
|
48
47
|
- lib/semantic_logger/railtie.rb
|
49
48
|
- lib/semantic_logger/version.rb
|
50
49
|
- lib/semantic_logger.rb
|
@@ -1,48 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# IGNORE THIS FILE
|
3
|
-
#
|
4
|
-
|
5
|
-
module SemanticLogger
|
6
|
-
module Appender
|
7
|
-
# Logger appender
|
8
|
-
#
|
9
|
-
# Maps the SemanticLogger API's to the Rails log, or Ruby Logger
|
10
|
-
#
|
11
|
-
# The following changes are made:
|
12
|
-
# The klass_name is prefixed on all log entries if available.
|
13
|
-
#
|
14
|
-
# Note: For performance, the original Rails Logger or Ruby Logger is returned,
|
15
|
-
# with that instance populated with the new API's to support SymanticLogger
|
16
|
-
#
|
17
|
-
# Installation:
|
18
|
-
# Rails.logger = SemanticLogger::LoggerAppender.new(Rails.logger)
|
19
|
-
# Also works with the Ruby Logger
|
20
|
-
# logger = Logger.new ....
|
21
|
-
# Rails.log = LoggerAppender.new()
|
22
|
-
#
|
23
|
-
# ActiveResource::BufferedLogger
|
24
|
-
# ...
|
25
|
-
#
|
26
|
-
# Append to the default Rails log
|
27
|
-
#
|
28
|
-
# Note: The Rails log must be initialized prior to this Appender being started
|
29
|
-
# Or, the original Rails log must be passed into the initializer
|
30
|
-
#
|
31
|
-
class Logger
|
32
|
-
@@level_map = {:trace => :debug, :debug=>:debug, :info=>:info, :warn=>:warn, :error=>:error}
|
33
|
-
|
34
|
-
# These are a problem at the appender level, need to move to API
|
35
|
-
# Not consistent with the other appenders levels
|
36
|
-
def level
|
37
|
-
@logger.level
|
38
|
-
end
|
39
|
-
|
40
|
-
def level=(new_level)
|
41
|
-
@logger.level = new_level
|
42
|
-
end
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|