Giter VIP home page Giter VIP logo

rails-callback_log's Introduction

RailsCallbackLog

Do you have a rails app with a lot of callbacks? Are they kind of a mystery? Maybe logging them would help.

Started GET "/" for 127.0.0.1 at 2016-07-26 13:25:32 -0400
Processing by HomeController#index as HTML
Callback: verify_authenticity_token
Callback: activate_authlogic
Callback: require_client_subdomain
  Client Load (0.4ms)  SELECT  `clients`.* ...
Callback: check_hostname
Callback: update_last_request_at
...

Installation

# Gemfile
gem "rails-callback_log", group: [:development, :test]

Do not use this gem in production because it adds significant overhead.

Filtering Output

Rails has a lot of its own callbacks that you probably don't care about. If you don't want to log them, enable filtering.

# Enable filtering
export RAILS_CALLBACK_LOG_FILTER="make it so"

# Disable filtering
unset RAILS_CALLBACK_LOG_FILTER

Filtering incurs a serious performance penalty, so it is off by default.

Team Opt-in

When working in a team and logging is needed only for select members, use this environment-based opt-in pattern:

# Gemfile
gem "rails-callback_log",
  group: [:development, :test],
  require: (ENV["LOG_RAILS_CALLBACKS"] == "true")

See Also

License

The gem is available as open source under the terms of the MIT License.

rails-callback_log's People

Contributors

dexterthedragon avatar jaredbeck avatar shanecav84 avatar

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

Watchers

 avatar  avatar  avatar

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.