pauldowman / better_logging Goto Github PK
View Code? Open in Web Editor NEW(Old/dead) A Rails plugin that improves the log format.
(Old/dead) A Rails plugin that improves the log format.
A bit ahead of the curve, perhaps, but I'm getting an error at runtime when I boot up a Rails 4 (beta1) server; evidently ActiveSupport::BufferedLogger
is no more.
/Users/bkreeger/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/better_logging-1.0.3/lib/better_logging/better_logging.rb:12:in `<module:BetterLogging>': uninitialized constant ActiveSupport::BufferedLogger (NameError)
from /Users/bkreeger/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/better_logging-1.0.3/lib/better_logging/better_logging.rb:10:in `<module:RailsPlugins>'
from /Users/bkreeger/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/better_logging-1.0.3/lib/better_logging/better_logging.rb:9:in `<module:PaulDowman>'
from /Users/bkreeger/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/better_logging-1.0.3/lib/better_logging/better_logging.rb:8:in `<top (required)>'
from /Users/bkreeger/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/better_logging-1.0.3/lib/better_logging.rb:2:in `require'
from /Users/bkreeger/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/better_logging-1.0.3/lib/better_logging.rb:2:in `<top (required)>'
from /Users/bkreeger/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/bundler-1.3.0/lib/bundler/runtime.rb:72:in `require'
from /Users/bkreeger/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/bundler-1.3.0/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
from /Users/bkreeger/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/bundler-1.3.0/lib/bundler/runtime.rb:70:in `each'
from /Users/bkreeger/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/bundler-1.3.0/lib/bundler/runtime.rb:70:in `block in require'
from /Users/bkreeger/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/bundler-1.3.0/lib/bundler/runtime.rb:59:in `each'
from /Users/bkreeger/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/bundler-1.3.0/lib/bundler/runtime.rb:59:in `require'
from /Users/bkreeger/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/bundler-1.3.0/lib/bundler.rb:132:in `require'
from /Users/bkreeger/Code/universal-uclick/support/otterloop/config/application.rb:10:in `<top (required)>'
from /Users/bkreeger/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/railties-4.0.0.beta1/lib/rails/commands.rb:76:in `require'
from /Users/bkreeger/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/railties-4.0.0.beta1/lib/rails/commands.rb:76:in `block in <top (required)>'
from /Users/bkreeger/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/railties-4.0.0.beta1/lib/rails/commands.rb:73:in `tap'
from /Users/bkreeger/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/railties-4.0.0.beta1/lib/rails/commands.rb:73:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
If/when I have time, I may submit a pull request to see if I can fix this, unless someone else beats me to it.
Hi
Nice gem ;-)
Is it possible to use the "custom string" o display the current_user ?
Thanks
Vincent
Plugins are being deprecated in Rails 3.2.0.rc2 and it would be nice to be able to choose which environments better logging gets loaded in.
Wouldn't it be useful to have the date with the time?
thx
Hello!
Commenting quickly, I used the plugin installation. Then tried to catch my exception:
log.error "oops", e
This gave me undefined method log error. Where am I supposed to define this, and how?
message = message.gsub(/^/, @@line_prefix) if @@verbose
because @@line_prefix was in 'UTF-8' and message was in 'US-ASCII'
only ruby 1.9.3.p0 affected - 1.9.3.p194 is OK.
I was able to fix it by adding something like
message.force_encoding("BINARY") if message.respond_to?(:force_encoding) && message.encoding.name != 'UTF-8'
before
message = message.gsub(/^/, @@line_prefix) if @@verbose
@@verbose = Rails.env == "development"
are you sure that checking rails env name in gem is a good idea ? It was pretty hard for me to find why I have two identical environments with same settings and only one of them is crashing.
To use Rails without a database, you must remove the Active Record framework -- this is noted in the default environment.rb file:
config.frameworks -= [ :active_record ]
If you disable Active Record, the better_logging plugin fails since it uses the ActiveRecord::Base.colorize_logging parameter. The error displayed is:
Error during failsafe response: uninitialized constant ActiveSupport::BufferedLogger::ActiveRecord
As a workaround, I commented out the colorizing section.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.