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

flow.log et al: Add or modify FATAL-related flow.log / flow.error APIs to possibly auto-abort(). #81

Open
ygoldfeld opened this issue Mar 10, 2024 · 0 comments
Labels
enhancement New feature or request from-akamai-pre-open Issue origin is Akamai, before opening source

Comments

@ygoldfeld
Copy link
Contributor

Filed by @ygoldfeld pre-open-source:

The FATAL severity was recently added to flow.log. suggested we could automatically std::abort() upon logging such a message. He also pointed out that perhaps this should be possibly to enable/disable at compile time (some #define) or even run-time. Personally I am not so sure that needs to be provided on a general-library basis (which Flow is); like to me FATAL means we are really screwed – there is no coming back from it maybe, so abort and hope for the best. Anyway there are various opinions to be had on this.

So I would say in Flow keep it simple: Add a couple of macros to use if desired:

  • FLOW_ERROR_ABORT_LOG(…) => FLOW_LOG_FATAL(…); std::abort()
  • FLOW_ERROR_ABORT_SYS_ERROR() => FLOW_ERROR_SYS_ERROR_LOG_FATAL(); std::abort()

I figure that decisions as to what one might want to do to conditionally abort() or not, depending on ??? – that can be left to the individual project. After all they can have their own 2 macros named (whatever) that would, e.g.:

  • FLOW_ERROR_ABORT(X) or FLOW_LOG_FATAL(X), depending on project-specific ???.
  • FLOW_ERROR_ABORT_SYS_ERROR(X) or FLOW_ERROR_SYS_ERROR_LOG_FATAL(X), depending on project-specific ???.

Then you can have each project follow whatever policy makes sense for them.

To be clear – FLOW_LOG_FATAL() continues to be available and won't abort anything. So one can log a number of FATAL messages and then do whatever they feel is right manually.

@ygoldfeld ygoldfeld added enhancement New feature or request from-akamai-pre-open Issue origin is Akamai, before opening source labels Mar 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request from-akamai-pre-open Issue origin is Akamai, before opening source
Projects
None yet
Development

No branches or pull requests

1 participant