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 a method for reporting warnings #80

Open
tomjnixon opened this issue May 4, 2021 · 0 comments
Open

Add a method for reporting warnings #80

tomjnixon opened this issue May 4, 2021 · 0 comments

Comments

@tomjnixon
Copy link
Member

Ideally it should be possible to report a problem without throwing an exception, and without just printing to stderr.

Some alternatives:

  1. use some 3rd party logging library which has a system for controlling where the output goes
  • advantage: easy
  • disadvantages: not very flexible, probably not re-entrant
  1. pass around an error handling callback
  • advantage: re-entrant, flexible
  • disadvantage: potentially a lot of work
  1. store a global error-handling callback
  • advantage: simple and flexible
  • disadvantage: not re-entrant

IMO it would be really good to have a "warning hierarchy" as in libear, to allow users to decide what to ignore, and what to turn into errors. This rules out option 1.

If 2 was implemented nicely, it might be possible to make messages really nice by adding context, like: "while parsing ABF_XXX: invalid time format 'yyy'".

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

1 participant