Git Product home page Git Product logo

better_logging's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

better_logging's Issues

Runtime error on Ruby 2, Rails 4

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.

Create Gem

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.

fails with "uninitialized constant... ActiveRecord" when using Rails without a database

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.

problems with encodings

  1. I had crashes at this line
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.

Adding date

Wouldn't it be useful to have the date with the time?

thx

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.