Only enable verbose_query_logs in Rails server #31690
Should fix #31688 unless someone can point me to a better way to achieve
That's especially true if we display absolute paths to callsites which
Related to #26815.
I haven't tested this locally yet so don't merge until the build has run and we can test it out a bit more.
Should fix #31688 unless someone can point me to a better way to achieve this goal. Essentially David's point was that verbose query logging when enabled in Rails console tends to make things very noisy. That's especially true if we display absolute paths to callsites which sadly is still the case when we detect a caller that isn't part of the Rails application — think gems. Discussed this with both @matthewd and @rafaelfranca and went back and forth between enabling if defined?(Rails::Server) or this implementation and this one makes more sense for now. Long term I think it'll make sense to let people override this default disabling in Rails Console because they might want to use the feature but for now it feels like the correct default behavior.