Skip to content

Commit b04d40e

Browse files
committed
Support logs
Signed-off-by: Andy Lok <andylokandy@hotmail.com>
1 parent 3424681 commit b04d40e

File tree

4 files changed

+44
-1
lines changed

4 files changed

+44
-1
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ crate-type = ["staticlib"]
1212
anyhow = "1"
1313
cxx = "=1.0.18"
1414
futures = "0.3"
15+
env_logger = "0.8"
1516
tikv-client = { git = "https://github.com/tikv/client-rust.git", rev = "72ab9b3" }

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ clean:
1313
cargo clean
1414

1515
run-example: target/tikv-example
16-
$(cur_makefile_path)/target/tikv-example
16+
RUST_LOG=debug $(cur_makefile_path)/target/tikv-example
1717

1818
target/tikv-example: target/debug/libtikv_client.a example/main.cpp
1919
c++ $(cur_makefile_path)/example/main.cpp -o $(cur_makefile_path)/target/tikv-example -std=c++17 -g -I$(cur_makefile_path)/include -L$(cur_makefile_path)/target/debug -ltikv_client -lpthread -ldl -lssl -lcrypto

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ struct Transaction {
104104
}
105105

106106
fn transaction_client_new(pd_endpoints: &CxxVector<CxxString>) -> Result<Box<TransactionClient>> {
107+
env_logger::init();
108+
107109
let pd_endpoints = pd_endpoints
108110
.iter()
109111
.map(|str| str.to_str().map(ToOwned::to_owned))

0 commit comments

Comments
 (0)