Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add __callstack__ to return methods calls #41

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mrloop
Copy link

@mrloop mrloop commented Oct 29, 2013

I wanted to be able to do something like this

Locals = Naught.build do |c|
  c.black_hole
  def to_s
    __callstack__.join('.')
  end
end

@mrloop
Copy link
Author

mrloop commented Oct 29, 2013

Updated to record method call arguments

@avdi
Copy link
Owner

avdi commented Jan 16, 2014

I'd be willing to merge something like this, but I have some notes I'd want to see addressed first:

  • this could blow up memory use in non-obvious ways. I'd like it to only be in effect when explicitly requested. It might make sense to integrate this with the traceable setting.

  • What happens when I use a null object more than once? Will the resulting trace concatenate the two uses as if they were one long call chain? E.g.:

    my_null.foo.bar
    my_null.baz.buz
  • It would be nice if the returned trace(s) contained objects that were roughly similar to Thread::Backtrace::Location

  • It may make sense to share some implementation with the pebble code.

@sferik sferik force-pushed the master branch 3 times, most recently from 0fa92ab to 4397306 Compare November 10, 2014 15:55
@sferik sferik force-pushed the master branch 4 times, most recently from 1dc5ada to 72228eb Compare September 6, 2015 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants