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

More discrete logging #1050

Closed
CharliePoole opened this issue Dec 15, 2021 · 3 comments · Fixed by #1126
Closed

More discrete logging #1050

CharliePoole opened this issue Dec 15, 2021 · 3 comments · Fixed by #1126

Comments

@CharliePoole
Copy link
Contributor

I'm working on the test agent, which is very hard to debug. So I rely a lot on logging.

What I find - have always found - about adding log entries is that debug log files get bigger and bigger (obviously) even though much of what is in them has nothing to do with the particular area where I'm debugging.

Ideally, it would be nice to specify at the command-line or in a config file what areas I'm interested in. I've done that in other apps. But for this issue, I'm thinking about something simpler, which will help us engine developers even though it's not so useful for users.

Suppose we treat the initialized internal trace level as a default and simply allow each logger, which is created in the code at the start of a file, to specify its own level. So this line...

var log = InternalTrace.GetLogger(typeof(SomeClass));

would continue to get the default level set at startup, while this one...

var log = InternalTrace.GetDebugLogger(typeof(SomeClass));

would give you a debug logger to use within the file.

An alternate syntax would be to overload give GetLogger an optional trace level argument, but that requires more typing. :_)

@nunit/engine-team I think this would be very easy to implement. Would it be helpful?

@CharliePoole
Copy link
Contributor Author

No comments on this yet but I felt I really needed it in some of the work I was doing recently so I'm making it an Enhancement and we can review the idea as a PR.

@CharliePoole CharliePoole self-assigned this Jan 1, 2022
@CharliePoole CharliePoole added this to the 3.13.1 milestone Jan 1, 2022
@mikkelbu
Copy link
Member

mikkelbu commented Jan 1, 2022

I don't have a strong opinion about this, as I've not been doing a lot of debugging of the console and/or agents, but if it helps you and is easy to implement, then I think it is fine to add.

@CharliePoole
Copy link
Contributor Author

This issue has been resolved in version 3.15.0-beta1

The release is available on:
GitHub.
NuGet packages are also available NuGet.org and
Chocolatey Packages may be found at Chocolatey.org

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

Successfully merging a pull request may close this issue.

2 participants