-
Notifications
You must be signed in to change notification settings - Fork 729
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
instrument macro: omit self
by default
#651
Comments
I'm definitely open to this --- skipping big I'd like to get input from others currently using Also, I think we'd need to work out whether or not this should be considered a breaking change. Existing code will still compile, but it won't behave as it did previously. Is this okay to do in a point release? |
I'm also in favor of this change. I think that, especially in Chalk, including
I think this should be treated as a breaking change. I think (@hawkw and I) discussed that format changes should be considered breaking changes, regardless if they're additive. |
I am +1 on this as well. |
big +1, i skip self constantly. What would the syntax for unskipping it be though? Ideas I can imagine
|
@yaahc I think the ideal solution would just be adding #[instrument(fields(self))] This could be implemented by special-casing |
So there would be |
+1 from me, I tend to think of methods happening "within the span" of |
Seems like most folks agree that this is the right thing, so we should probably move forwards with it. Re: whether or not to consider it a breaking change
@davidbarsky IIRC, this conversation was largely in re: |
We think of structured diagnostics data as an ad-hoc ABI whenever you take dependencies on it. I’m not sure that means it’s a semver breaking change to do this but it’s definitely something which (in a future with more usage) could cause broken tests when rolling versions. |
I personally think that its okay to expect the library that implements the logging format to have a different stability policy for log output than the applications/libraries that consume and expose it. But I also want this asap so if making it a breaking change means its gonna take a while because we will need to batch the change with other upcoming breakages then I'd vote we just treat it as irrelevant to semver. |
Another thing we could do is release an 0.2x version of I'm not sure if this is worth the effort. |
Assigning this to myself and starting to work on this now. Based on discussions with @hawkw I think we're going to try just skipping all fields by default and make logging of function parameters entirely opt in as of tracing 0.2. Plan description
Questions
|
That would be lovely actually, let me know if you have any questions about where I left it. |
I have a first draft in #1306 - there are a couple of open questions to resolve, then I can start the big piece work of updating documentation/examples/etc. |
Agree that skipping everything by default is better. The issue should be renamed perhaps? |
Feature Request
The
#[instrument]
proc macro should probably omitself
by default as it is pretty noisy.If #650 happens, this could be used as a way to get access to
self
again.The text was updated successfully, but these errors were encountered: