@@ -52,7 +52,7 @@ extern "C" {
5252/// When using ObjectBox as a dynamic library, you should verify that a compatible version was linked using
5353/// obx_version() or obx_version_is_at_least().
5454#define OBX_VERSION_MAJOR 5
55- #define OBX_VERSION_MINOR 1
55+ #define OBX_VERSION_MINOR 3
5656#define OBX_VERSION_PATCH 0 // values >= 100 are reserved for dev releases leading to the next minor/major increase
5757
5858//----------------------------------------------
@@ -113,6 +113,11 @@ OBX_C_API bool obx_version_is_at_least(int major, int minor, int patch);
113113/// @see obx_version() and obx_version_is_at_least() for integer based versions
114114OBX_C_API const char * obx_version_string (void );
115115
116+ /// Return the (runtime) version of the library to be printed.
117+ /// The format is "YYYY-MM-DD" (e.g. "2026-02-16") and thus can be compared lexicographically.
118+ /// @see obx_version() and obx_version_is_at_least() for integer based versions.
119+ OBX_C_API const char * obx_version_date_string (void );
120+
116121/// Return the version of the ObjectBox core to be printed (currently also contains a version date and features).
117122/// The format may change in any future release; only use for information purposes.
118123OBX_C_API const char * obx_version_core_string (void );
@@ -191,22 +196,18 @@ OBX_C_API bool obx_has_feature(OBXFeature feature);
191196// Utilities
192197//----------------------------------------------
193198
194- /// Log level as passed to obx_log_callback.
199+ /// Log level used by obx_log_level_set(), obx_log_level_get(), and obx_log_callback().
200+ /// @note Values were changed in version 5.3 (previously 10/20/30/40/50 for Verbose..Error);
201+ /// update your code if you relied on the old numeric values.
195202typedef enum {
196- /// Log level for verbose messages (not emitted at the moment)
197- OBXLogLevel_Verbose = 10 ,
198-
199- /// Log level for debug messages (may be limited to special debug builds)
200- OBXLogLevel_Debug = 20 ,
201-
202- /// Log level for info messages
203- OBXLogLevel_Info = 30 ,
204-
205- /// Log level for warning messages
206- OBXLogLevel_Warn = 40 ,
207-
208- /// Log level for error messages
209- OBXLogLevel_Error = 50 ,
203+ OBXLogLevel_All = 0 , ///< Enable all log output.
204+ OBXLogLevel_Trace = 1 , ///< Most detailed; typically only for short-term investigations.
205+ OBXLogLevel_Verbose = 2 , ///< Very detailed; not printed by default.
206+ OBXLogLevel_Debug = 3 , ///< Detailed output useful during development/debugging.
207+ OBXLogLevel_Info = 4 , ///< Informational messages (default for release builds).
208+ OBXLogLevel_Warn = 6 , ///< Noteworthy issues that are not necessarily errors.
209+ OBXLogLevel_Error = 8 , ///< Only for "bad things happened" (e.g. internal errors).
210+ OBXLogLevel_None = 10 , ///< Disable all log output.
210211} OBXLogLevel ;
211212
212213/// Callback for logging, which can be provided to store creation via options.
@@ -224,13 +225,27 @@ OBX_C_API size_t obx_db_file_size(char const* directory);
224225/// Enable (or disable) debug logging for ObjectBox internals.
225226/// This requires a version of the library with the DebugLog feature.
226227/// You can check if the feature is available with obx_has_feature(OBXFeature_DebugLog).
228+ /// @Deprecated: prefer obx_log_level_set() with OBXLogLevel_Debug / OBXLogLevel_Info.
227229OBX_C_API obx_err obx_debug_log (bool enabled );
228230
229- /// Checks if debug logs are enabled for ObjectBox internals. This depends on the availability of the DebugLog feature.
231+ /// Checks if debug logs are enabled for ObjectBox internals.
232+ /// This depends on the availability of the DebugLog feature.
230233/// If the feature is available, it returns the current state, which is adjustable via obx_debug_log().
231- /// Otherwise, it always returns false for standard release builds (or true if you are having a special debug version).
234+ /// Otherwise, it always returns false for standard release builds
235+ /// (or true if you are having a special debug version).
236+ /// @Deprecated: Prefer obx_log_level_get() and compare against OBXLogLevel_Debug.
232237OBX_C_API bool obx_debug_log_enabled ();
233238
239+ /// Sets the runtime log level for ObjectBox internals.
240+ /// Log messages below the given level will not be printed (provided they are compiled into the library).
241+ /// @note Without the DebugLog feature, log messages at debug level and below are not compiled in;
242+ /// use obx_has_feature(OBXFeature_DebugLog) to check.
243+ OBX_C_API obx_err obx_log_level_set (OBXLogLevel log_level );
244+
245+ /// Gets the current runtime log level for ObjectBox internals.
246+ /// @returns One of the OBXLogLevel values.
247+ OBX_C_API OBXLogLevel obx_log_level_get ();
248+
234249/// Gets the number, as used by ObjectBox, of the current thread.
235250/// This e.g. allows to "associate" the thread with ObjectBox logs (each log entry contains the thread number).
236251OBX_C_API int obx_thread_number ();
@@ -619,6 +634,21 @@ typedef enum {
619634 /// If a date property has this flag (max. one per entity type), the date value specifies the time by which
620635 /// the object expires, at which point it MAY be removed (deleted), which can be triggered by an API call.
621636 OBXPropertyFlags_EXPIRATION_TIME = 65536 ,
637+
638+ /// Marks a Long (64-bit integer) property as the sync clock, a "hybrid logical clock" to resolve Sync conflicts.
639+ /// These clock values allow "last write wins" conflict resolution.
640+ /// There can be only one sync clock per sync entity type; which is also recommended for basic conflict resolution.
641+ /// For new objects, initialize a property value to 0 to reserve "a slot" in the object data.
642+ /// ObjectBox Sync will update this property automatically on put operations.
643+ /// As a hybrid clock, it combines a wall clock with a logical counter to compensate for some clock skew effects.
644+ OBXPropertyFlags_SYNC_CLOCK = 131072 ,
645+
646+ /// Marks a Long (64-bit integer) property as the "sync precedence" to customize Sync conflict resolution.
647+ /// Developer-assigned precedence values are then used to resolve conflicts via "higher precedence wins".
648+ /// Defining and assigning precedence values are completely in the hands of the developer (the ObjectBox user).
649+ /// There can be only one sync precedence per sync entity type.
650+ /// Typically, it is combined with a sync clock, with the latter being the tie-breaker for equal precedence values.
651+ OBXPropertyFlags_SYNC_PRECEDENCE = 262144 ,
622652} OBXPropertyFlags ;
623653
624654/// A property type of an external system (e.g. another database) that has no default mapping to an ObjectBox type.
0 commit comments