Skip to content

Logging initializer should be gated behind a configuration flag #5

Description

@dmolesUC

Requiring berkeley_library/logging in a Rails app unconditionally runs the initializer from the Railtie. It would be nice if (as in Lograge) there was a configuration flag allowing this to be disabled.

As a workaround, I was able to make the initializer a no-op by adding the following to my application.rb:

config.before_configuration do
  Rails.application.initializers
    .find { |init| init.name == 'logging.configure_berkeley_library_logging' }
    .instance_variable_set(:@block, ->(_app) {})
end

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions