MrDys / blacklight

Blacklight Plugin
http://projectblacklight.org/
Other
1 stars 1 forks source link

Blacklight status logging on every request in development #519

Closed MrDys closed 12 years ago

MrDys commented 12 years ago

CODEBASE-336: Originally the idea was that on boot, Blacklight would print out it's version, and the Blacklight.config hash, and some other useful debugging stuff.

This has ended up being a mess to make work right in BL3, for various confusing reasons. Lots of time has already been spent on it.

It's currently done in Blacklight.init : https://github.com/projectblacklight/blacklight/blob/master/lib/blacklight.rb#L45

Now it doens't cause any exceptions, but as a side-effect of various workarounds, and for reasons I don't entirely understand, this Blacklight.init method ends up getting called before every request in development mode, (cache_classes=false), you get this LENGTHY debugging output before every request, not just on boot.

This makes watching your output (for excpetions and deprecation notices) extremely difficult.

Outputting this logging is all Blacklight.init seems to do.

I propose simply eliminating Blacklight.init for now, so we can stop this problem before the 3.0 release. If someone wants to figure out how to put logging back in without this problem, and still without regressions on the many other problems that got us to this point -- they can try. But for some reason this stuff has ended up requring dealing with confusing deep Rails stuff, and it's just not worth it.

MrDys commented 12 years ago

Original reporter: jrochkind

MrDys commented 12 years ago

jrochkind: committers call said they wanted to make sure that Blacklight.solr_config gets called on boot, for "fail early" if it's not there.

So I will just try to make it NOT get called on every request in development, and perhaps change the method to 'log_on_startup' or something.

MrDys commented 12 years ago

jrochkind: Fixed, mostly. At least it doesn't output on every request anymore. (Now it only outputs on startup, but only to logfile and not console even if you are 'rails server', sorry).

http://bit.ly/j3iKvk