Skip to content

Commit b469ef1

Browse files
committed
add libsql_enable_tracing to the libsql
1 parent cece90a commit b469ef1

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed

Cargo.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindings/c/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ bytes = "1.5.0"
1515
lazy_static = "1.4.0"
1616
tokio = { version = "1.29.1", features = [ "rt-multi-thread" ] }
1717
hyper-rustls = { version = "0.25", features = ["webpki-roots"]}
18+
tracing = "0.1.40"
19+
tracing-subscriber = "0.3.18"
1820

1921
[target.'cfg(not(any(target_os = "ios", target_os = "android")))'.dependencies]
2022
libsql = { path = "../../libsql", features = ["encryption"] }

bindings/c/include/libsql.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ typedef struct {
6161
extern "C" {
6262
#endif // __cplusplus
6363

64+
void libsql_enable_tracing(void);
65+
6466
int libsql_sync(libsql_database_t db, const char **out_err_msg);
6567

6668
int libsql_sync2(libsql_database_t db, replicated *out_replicated, const char **out_err_msg);

bindings/c/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ unsafe fn set_err_msg(msg: String, output: *mut *const std::ffi::c_char) {
3131
}
3232
}
3333

34+
#[no_mangle]
35+
pub unsafe extern "C" fn libsql_enable_tracing() {
36+
tracing_subscriber::fmt::init();
37+
}
38+
3439
#[no_mangle]
3540
pub unsafe extern "C" fn libsql_sync(
3641
db: libsql_database_t,

0 commit comments

Comments
 (0)