Skip to content

Add option to output warnings from sentry_init()Β #888

Open

Description

If sentry_init() fails, it seems that currently the only way to figure out what caused it to fail is to enable debug logs with sentry_options_set_debug(). It would be helpful to have an option to always output initialization warnings and errors, without also outputting debug output.

This could be achieved by adding a method like this to set the output level:

sentry_options_set_output_level(sentry_options_t *opts, sentry_level_t level);

In the following example logs (obtained by enabling debug logs), calling the above function with SENTRY_LEVEL_WARNING only the logs marked WARN should be output:

[sentry] INFO using database path "C:\..."
[sentry] DEBUG starting transport
[sentry] DEBUG starting background worker thread
[sentry] DEBUG starting backend
[sentry] WARN unable to start crashpad backend, invalid handler_path
[sentry] WARN failed to initialize backend
[sentry] WARN `sentry_init` failed
[sentry] DEBUG shutting down transport
[sentry] DEBUG shutting down background worker thread
[sentry] DEBUG submitting task to background worker thread
[sentry] DEBUG background worker thread started
[sentry] DEBUG executing task on worker thread
[sentry] DEBUG background worker thread shut down
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status

      Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions