Skip to content

[wip] [Debug] Improvements, compat and Object tracer #12159

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

Closed
wants to merge 1 commit into from
Closed

[wip] [Debug] Improvements, compat and Object tracer #12159

wants to merge 1 commit into from

Conversation

nicolas-grekas
Copy link
Member

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

Here are some ideas that we worked on with @jpauli and that we propose for enhancement and inclusion in the symfony_debug extension for 2.7:

  • symfony_debug_backtrace() is like debug_backtrace(), except that it can fetch the full backtrace in case of fatal errors (prod friendly version of xdebug_get_function_stack())
  • symfony_debug_set_logger() logs objects' creations/destructions

Your ideas are more than welcomed: the name/interface of the functions can certainly be improved, and if you have more ideas, we can't wait to hear them :)

@nicolas-grekas nicolas-grekas changed the title [Debug] Improvements, compat and Object tracer [wip] [Debug] Improvements, compat and Object tracer Oct 6, 2014
@fabpot fabpot added the Debug label Dec 7, 2014
fabpot added a commit that referenced this pull request Apr 3, 2015
…dealing with fatal errors (jpauli, nicolas-grekas)

This PR was merged into the 2.7 branch.

Discussion
----------

[Debug] Add symfony_debug_backtrace() and use it when dealing with fatal errors

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

This takes a subset of #12159 that would be great in 2.7, and uses it to gather back traces of fatal errors when possible.

Commits
-------

5cbd9fe [Debug] Updated CHANGELOG
beb88f7 [Debug] Use symfony_debug_backtrace() in FatalErrorException when available
6487b6e [Debug] Add debug extension to the test suite
eacdc62 [Debug] Add symfony_debug_backtrace() that works with fatal errors
@Koc
Copy link
Contributor

Koc commented May 22, 2015

Very good addition for catching fatal errors in prod. @fabpot no way to include this in 2.7 branch?

Added symfony_debug_set_object_tracer_logger()
Added symfony_debug_enable_var_dumper_dump()

Performed improvements and compat

Added PHP Object lifetime tracer
@Koc
Copy link
Contributor

Koc commented Aug 13, 2015

@fabpot @nicolas-grekas no way to include it into 2.8 release?

@nicolas-grekas
Copy link
Member Author

@Koc do/did you use these features for real?

@Koc
Copy link
Contributor

Koc commented Aug 13, 2015

We want log fatal errors with traces in prod env, so function

symfony_debug_backtrace() is like debug_backtrace(), except that it can fetch the full backtrace in case of fatal errors (prod friendly version of xdebug_get_function_stack())

would be mush useful for us.

@nicolas-grekas
Copy link
Member Author

Then you missed it: this very feature is already released in 2.7

@jpauli
Copy link

jpauli commented Aug 13, 2015

Just to let you know, the debug PHP extension is like the Debug component : tools aimed for debugging purposes only and dev env.
I don't recommand using this code on production, it has not been tested for production run (may leak memory or crash in some cases / under certain platforms); which is not really embarrassing while in dev

@nicolas-grekas
Copy link
Member Author

@jpauli it would be great that the currently released features (not the one in this PR but those in the 2.7 branch) are reviewed so that prod usage is confirmed to be safe.

@fabpot fabpot closed this Oct 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants