Skip to content

Flow ILogger to InstrumentationHelper #559

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
MarcoRossignoli opened this issue Sep 19, 2019 · 5 comments · Fixed by #727
Closed

Flow ILogger to InstrumentationHelper #559

MarcoRossignoli opened this issue Sep 19, 2019 · 5 comments · Fixed by #727
Labels
enhancement General enhancement request up-for-grabs Good issue for contributors

Comments

@MarcoRossignoli
Copy link
Collaborator

MarcoRossignoli commented Sep 19, 2019

We should flow the logger to instrumentation helper and emit important log warning here

https://github.com/tonerdo/coverlet/blob/82a920864a157bfaa9417540a20a4c03b336f1d0/src/coverlet.core/Helpers/InstrumentationHelper.cs#L155-L159

cc: @tonerdo @petli

@MarcoRossignoli MarcoRossignoli added enhancement General enhancement request up-for-grabs Good issue for contributors labels Sep 19, 2019
@MarcoRossignoli
Copy link
Collaborator Author

wait for #566 to allow internal helper interfaces access.

@daveMueller
Copy link
Collaborator

@MarcoRossignoli Could you explain this in a bit more detail. I'm not sure if I get it right. Just inject ILogger and log a message in this catch block?

@MarcoRossignoli
Copy link
Collaborator Author

Yup Dave, this class is the core of instrumentation and sometimes it's very useful log behaviour, so for now the work here is only flow ILogger and add some trace here.

@daveMueller
Copy link
Collaborator

I'm currently working on this and think about the message to be logged?
Actually I'm also a bit confused why true is returned when the provider throws. How is instrumentation working when the source can't be found?

@MarcoRossignoli
Copy link
Collaborator Author

MarcoRossignoli commented Jan 20, 2020

I'm currently working on this and think about the message to be logged?

A warning like "BadImageFormatException during MetadataReaderProvider.FromPortablePdbStream in InstrumentationHelper .PortablePdbHasLocalSource, unable to check if module has got local source"

Actually I'm also a bit confused why true is returned when the provider throws. How is instrumentation working when the source can't be found?

That is only the procedure to automatically exclude dll that we're "SURE" that we cannot instrument, it's a new feature and wasn't present in past, so my idea is to "preserve" old semantic and go on like the check doesn't exist. Coverlet is used also with .NET Framework(not only core) coverage and pdb could not be portable. MetadataReaderProvider.FromPortablePdbStream is not part of Cecil that could work also with non portable pdb(btw I did't check, but the general idea is to preserve old behaviour if I'm not sure of new one).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement General enhancement request up-for-grabs Good issue for contributors
Projects
None yet
2 participants