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

Enable storage of full backtrace for each records #467

Closed
shadyvb opened this issue Apr 28, 2014 · 5 comments
Closed

Enable storage of full backtrace for each records #467

shadyvb opened this issue Apr 28, 2014 · 5 comments

Comments

@shadyvb
Copy link
Contributor

shadyvb commented Apr 28, 2014

Reference: http://wordpress.org/support/topic/timestamp-setting-was-updated

Having a filterable value, that when filtered to true would store full backtrace in each record meta, or in errorlog ( so we don't have to delete those later when we switch this filter off ), or even pass it to a registered callback.

Example, in the end of the log method of WP_Stream_Log:

if ( false !== apply_filters( 'wp_stream_debug_backtrace', false ) ) {
  error_log( sprintf( "Stream #%d \n%s", $insert_id, implode( "\n", debug_backtrace() ) ) );
}
@westonruter
Copy link
Contributor

I think you'd need to use debug_print_backtrace() and do some output buffering to route it to the error log.

@shadyvb
Copy link
Contributor Author

shadyvb commented Apr 29, 2014

@westonruter What is the advantage of debug_print_backtrace to debug_backtrace ?

@westonruter
Copy link
Contributor

debug_print_backtrace() outputs something that is concise and readable. debug_backtrace() outputs the underlying raw data, potentially a huge array.

@fjarrett
Copy link
Contributor

+1 for adding this as Stream meta

@lukecarbis
Copy link
Contributor

👍

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

No branches or pull requests

4 participants