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

Develop info-/error-message printing library functions, support log-level for messages. #165

Open
gapisback opened this issue Jul 31, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@gapisback
Copy link
Collaborator

A recent PR #162 has introduced a large collection of diffs of this nature:

-    printf("Executable read failed\n");
+    printf("%s() error, line %d, Executable read failed\n",
+         __func__, __LINE__);

The change itself is useful for improved troubleshooting.

However, we need a flexible interface that can be applied to all places where such messages are printed.
Some ideas: (which were aired out & discussed with CC-core dev team before logging this issue)

  • Synthesize other caller-info in the form: %s:%d::%s(), passing-in __FILE__, __LINE__, __func__, so that we consistently see the 3-part code location identifier
  • Support some form of info / message log-level
  • Provide a way to print either to stdout, stderr, or to some log file / output stream.

Study existing implementations for this kind of interface and under this issue, prototype a set of initial changes that support this functionality. Work-up an implementation in few typical places, to see how the usability aspects are.

Once the base interfaces and accepted and finalized, actual roll-out and implementation in the entire Certifier code base will be done in follow-on PRs.

@gapisback gapisback self-assigned this Jul 31, 2023
@gapisback gapisback added the enhancement New feature or request label Jul 31, 2023
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