@@ -2006,17 +2006,27 @@ SENTRY_EXPERIMENTAL_API int sentry_options_get_propagate_traceparent(
20062006
20072007/**
20082008 * Enables or disables the structured logging feature.
2009- * When disabled, all calls to sentry_logger_X() are no-ops.
2009+ * When disabled, all calls to `sentry_log_X()` are no-ops.
20102010 */
20112011SENTRY_EXPERIMENTAL_API void sentry_options_set_enable_logs (
20122012 sentry_options_t * opts , int enable_logs );
20132013SENTRY_EXPERIMENTAL_API int sentry_options_get_enable_logs (
20142014 const sentry_options_t * opts );
20152015
2016+ /**
2017+ * Enables or disables custom attributes parsing for structured logging.
2018+ *
2019+ * When enabled, all `sentry_log_X()` functions expect a `sentry_value_t` object
2020+ * as the first variadic argument for custom log attributes. Remaining
2021+ * arguments are used for format string substitution.
2022+ *
2023+ * Disabled by default.
2024+ */
20162025SENTRY_EXPERIMENTAL_API void sentry_options_set_logs_with_attributes (
20172026 sentry_options_t * opts , int logs_with_attributes );
20182027SENTRY_EXPERIMENTAL_API int sentry_options_get_logs_with_attributes (
20192028 const sentry_options_t * opts );
2029+
20202030/**
20212031 * The potential returns of calling any of the sentry_log_X functions
20222032 * - Success means a log was enqueued
@@ -2054,6 +2064,15 @@ typedef enum {
20542064 *
20552065 * Flags, width, and precision specifiers are parsed but currently ignored for
20562066 * parameter extraction purposes.
2067+ *
2068+ * When the option `logs_with_attributes` is enabled, the first varg is parsed
2069+ * as a `sentry_value_t` object containing the initial attributes for the log.
2070+ * You can pass `sentry_value_new_null()` to logs which don't need attributes.
2071+ * TODO Default log attributes will (currently) overwrite passed-in attributes.
2072+ * Ownership of the attributes is transferred to the log function.
2073+ *
2074+ * To re-use the same attributes, call `sentry_value_incref` on it
2075+ * before passing the attributes to the log function.
20572076 */
20582077SENTRY_EXPERIMENTAL_API log_return_value_t sentry_log_trace (
20592078 const char * message , ...);
0 commit comments