Skip to content

stdlib: add a utility to print what and where dynamic metadata is created. #32467

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

Conversation

eeckstein
Copy link
Contributor

The logging can be enabled at runtime with _setMetaDataDebugging(logLevel: Int).
Depending on the log level it prints what metadata is created and also where it is created (the backtrace).

…ated.

The logging can be enabled at runtime with _setMetaDataDebugging(logLevel: Int).
Depending on the log level it prints what metadata is created and also where it is created (the backtrace).
@eeckstein eeckstein requested a review from mikeash June 19, 2020 12:55
@eeckstein
Copy link
Contributor Author

@airspeedswift I used this to analyze the recent code sample. You might find this useful as well.

@eeckstein
Copy link
Contributor Author

@swift-ci smoke test

@mikeash
Copy link
Contributor

mikeash commented Jun 19, 2020

swift-inspect can do this now. Is this approach more useful in some scenarios?

@eeckstein
Copy link
Contributor Author

I was inspired by swift-inspect :-)
This can print the backtrace. So you get the information where the metadata is created

@mikeash
Copy link
Contributor

mikeash commented Jun 19, 2020

swift-inspect can do backtraces too, now! #32244

@eeckstein
Copy link
Contributor Author

Interesting! I didn't know

@eeckstein
Copy link
Contributor Author

Well, then this doesn't add much value. Except maybe that you can programmatically turn on/off logging and it's maybe useful for testing, e.g. lit tests which check that certain metadata is not generated

@mikeash
Copy link
Contributor

mikeash commented Jun 19, 2020

Interesting idea with the tests, that could be pretty valuable!

@eeckstein eeckstein closed this Jul 16, 2020
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