>  1. Is it possible to disable or change the behavior of ABSL_LOG(FATAL)
and ABSL_CHECK_* macros?
> 3. Should i be concerned about this macros in Message and LiteMessage
classes? Or it's unlikely that i will ever face them (and further
termination)?

Protobuf only uses these panic macros sparingly in places would mean we're
in a "should be impossible" and unrecoverable state, potentially from
corruption by the application code invoking C++ Undefined Behavior, or
(more rarely) a severe bug the Protobuf code itself. They are not intended
to be hit in the normal course of execution of a program unless there's a
very severe bug happening, eg, a parse() on any arbitrary bytes is intended
to never reach one of these panics, it will always gracefully succeed or
fail.

You could vendor either protobuf or absl into your repository and change
the behavior of these macros, but we wouldn't recommend it since if those
would ever be reached something is very wrong and the realistically the
only things that could happen if you continue execution is either a crash
immediately afterwards or else data corruption.

> 2. Does protobuf API have some extension points for logging? In my app i
have custom logging system.

ABSL allows for integrating into your own custom logging system with
absl::LogSink; it lets you do that at a global level which you can use for
this context.

On Wed, Oct 16, 2024 at 7:11 AM Vanegicloh J <[email protected]> wrote:

> Hello.
>
> I use C++ protobuf Message and LiteMessage classes. I'm a bit concerned
> about ABSL macros. As i understand ABSL_LOG(FATAL) and ABSL_CHECK_*
> macros will terminate the program. For my app it's unacceptable to
> terminate. Could you please make it clear:
>
> 1. Is it possible to disable or change the behavior of ABSL_LOG(FATAL)
> and ABSL_CHECK_* macros?
> 2. Does protobuf API have some extension points for logging? In my app i
> have custom logging system.
> 3. Should i be concerned about this macros in Message and LiteMessage
> classes? Or it's unlikely that i will ever face them (and further
> termination)?
>
> Thank you.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/protobuf/126cd1cb-1ead-47dc-9a55-6b5b685731dbn%40googlegroups.com
> <https://groups.google.com/d/msgid/protobuf/126cd1cb-1ead-47dc-9a55-6b5b685731dbn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/CAKRmVH8%2BT3mSgJzgx3vg%3DWjUzRzCePan4WSradsxEUjO9JESmg%40mail.gmail.com.

Reply via email to