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

Request mechanism to enable/disable Debug.Writeline #27

Open
DaveBlakeman opened this issue Apr 16, 2019 · 2 comments
Open

Request mechanism to enable/disable Debug.Writeline #27

DaveBlakeman opened this issue Apr 16, 2019 · 2 comments

Comments

@DaveBlakeman
Copy link

DaveBlakeman commented Apr 16, 2019

The caching mechanism writes unconditional messages to Debug.Writeline.

Debug.WriteLine("Cache entry released: " + key);
Debug.WriteLine("Expression retrieved from cache: " + expression);
Debug.WriteLine("Expression added to cache: " + expression);

Could we add a

boolean DebugLogging;

property (default = true). If DebugLogging = false, don't write these messages.

Or alternately a more general mechanism to specify

DebugVerbosity = (None, Low, Medium, High, Garrulous etc)

to allow for additional logging later.

I'm happy to do this, but wanted feedback on the preferred approach.

A bit of background as to why this matters:-

In an example I'm working with there are over 10,000 calls to Debug.WriteLine in NCalc due to cached expressions. We are using NCalc via a DLL, which itself plugs in to UnrealEngine and the SDK is swamped with these messages, making development excruciatingly slow. All solutions to remove these messages at the host end are complex and slow.

@DaveBlakeman
Copy link
Author

DaveBlakeman commented Apr 16, 2019

On reflection, a better name for the property would be 'CacheLogging', to avoid any interference with any future logging needs.

@cd21h
Copy link

cd21h commented Apr 19, 2019

I'd recommend something like https://github.com/damianh/LibLog instead

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

No branches or pull requests

2 participants