Skip to content

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

Description

@ygoldfeld

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestfrom-akamai-pre-openIssue origin is Akamai, before opening source

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions