lumber 0.10.2 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +3 -0
- data/CHANGELOG +15 -0
- data/LICENSE +1 -1
- data/README.md +65 -0
- data/Rakefile +0 -58
- data/TODO +1 -2
- data/lib/lumber.rb +7 -0
- data/lib/lumber/level_util.rb +112 -0
- data/lib/lumber/lumber.rb +14 -1
- data/lib/lumber/railtie.rb +38 -0
- data/lib/lumber/server.rb +57 -0
- data/lib/lumber/server/public/lib/bootstrap/css/bootstrap-responsive.css +808 -0
- data/lib/lumber/server/public/lib/bootstrap/css/bootstrap-responsive.min.css +9 -0
- data/lib/lumber/server/public/lib/bootstrap/css/bootstrap.css +4960 -0
- data/lib/lumber/server/public/lib/bootstrap/css/bootstrap.min.css +9 -0
- data/lib/lumber/server/public/lib/bootstrap/img/glyphicons-halflings-white.png +0 -0
- data/lib/lumber/server/public/lib/bootstrap/img/glyphicons-halflings.png +0 -0
- data/lib/lumber/server/public/lib/bootstrap/js/bootstrap.js +1824 -0
- data/lib/lumber/server/public/lib/bootstrap/js/bootstrap.min.js +6 -0
- data/lib/lumber/server/public/lib/jquery-1.7.min.js +4 -0
- data/lib/lumber/server/views/_levels_row.erb +17 -0
- data/lib/lumber/server/views/layout.erb +30 -0
- data/lib/lumber/server/views/levels.erb +79 -0
- data/lib/lumber/version.rb +1 -1
- data/lumber.gemspec +5 -1
- data/spec/level_util_spec.rb +82 -0
- data/spec/server_spec.rb +109 -0
- data/spec/spec_helper.rb +8 -2
- metadata +86 -4
- data/README.rdoc +0 -44
- data/VERSION +0 -1
data/README.rdoc
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
= lumber
|
2
|
-
|
3
|
-
Lumber tries to make it easy to use the more robust log4r[http://log4r.sourceforge.net/] logging system within your rails application.
|
4
|
-
To do this it sets up log4r configuration from a yml file, and provides utility methods for adding a
|
5
|
-
:logger accessor to classes dynamically as they get created. In the default setup shown below, calls
|
6
|
-
to logger from a model/controller/mailer, will include that classes name in the log output.
|
7
|
-
|
8
|
-
To use it, first "gem install lumber", run the lumber generator (./script generate lumber) to get the log4r.yml config file, then make the following edits
|
9
|
-
to config/environment.rb:
|
10
|
-
|
11
|
-
# before Rails::Initializer.run
|
12
|
-
#
|
13
|
-
require 'lumber'
|
14
|
-
Lumber.init()
|
15
|
-
|
16
|
-
# Setup parent loggers for some known rails Base classes. Classes that inherit
|
17
|
-
# from these will have their logger as a parent so you can configure logging for
|
18
|
-
# subtrees of classes in log4r.yml
|
19
|
-
Lumber.setup_logger_hierarchy("ActiveRecord::Base", "rails::models")
|
20
|
-
Lumber.setup_logger_hierarchy("ActionController::Base", "rails::controllers")
|
21
|
-
Lumber.setup_logger_hierarchy("ActionMailer::Base", "rails::mailers")
|
22
|
-
|
23
|
-
# If you really want, you can make all classes have a logger
|
24
|
-
# Lumber.setup_logger_hierarchy("Object", "root::object")
|
25
|
-
|
26
|
-
Additionally, you can also add loggers to individual classes by including the LumberLoggerSupport module
|
27
|
-
class Foo
|
28
|
-
include Lumber::LoggerSupport
|
29
|
-
end
|
30
|
-
|
31
|
-
and Foo.logger/Foo.new.logger will log to a logger named "rails::Foo". This creates a heirarchy of loggers for classes
|
32
|
-
nested within modules, so you can use the namespace to enable/disable loggers
|
33
|
-
|
34
|
-
If you want to change the log level for a different environment, add a line like below to the config/environments/<env>.rb
|
35
|
-
|
36
|
-
# Set info as the default log level for production
|
37
|
-
Log4r::Logger.root.level = Log4r::INFO
|
38
|
-
|
39
|
-
You should be able to use lumber in a non-rails project too, but your call to Lumber.init will need to be different.
|
40
|
-
I don't currently need to do this, so let me know if you have any problems.
|
41
|
-
|
42
|
-
== Copyright
|
43
|
-
|
44
|
-
Copyright (c) 2009 Matt Conway. See LICENSE for details.
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.10.0
|