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

Add debug/verbose printing modes and make console output optional #87

Open
ttj opened this issue Apr 20, 2020 · 0 comments
Open

Add debug/verbose printing modes and make console output optional #87

ttj opened this issue Apr 20, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@ttj
Copy link
Contributor

ttj commented Apr 20, 2020

As the project has evolved, we should now standardize on output formatting and verbose printing, as there is a lot of output always print. This can decrease performance, particularly depending on the host platform and how it handles this.

Typically one would have a specialized print function, that would determine the level of output messages based on some options. For example, we could add a print_nnv() function. A globally defined option could then determine if messages get printed or not. This conditional check can add some overhead, but typically negligible relative to (or on some platforms, this can be done with constants at compile time instead of runtime). This post has some reasonable overview of how this is typically done in different projects:

https://stackoverflow.com/questions/312378/debug-levels-when-writing-an-application

E.g., something along the lines of the following:

print_nnv() {
    if global_verbose == 1:
        print() everything
    elif global_verbose == 2:
        print() only errors
    elif global_verbose == 3:
       print() errors and warnings
    etc.
}

I will add a basic version of this print message, but then we will need to update a lot of code to replace existing references to other print/display functions with this.

Related to this, I would also suggest we fully standardize the output generation of images/tables, etc. This is partly done in the codeocean, but we need to add it in for additional places. See e.g.:

https://github.com/verivital/nnv/blob/master/code/nnv/engine/utils/path_results.m

https://github.com/verivital/nnv/blob/master/code/nnv/examples/Submission/CAV2020/ACC/verify_linear_ACC.m#L144

https://github.com/verivital/nnv/blob/master/code/nnv/examples/Submission/CAV2020/ACC/plot_linear_ACC_reachSets.m#L174

@ttj ttj added the enhancement New feature or request label Apr 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant