Skip to content

Commit 1ca3660

Browse files
Rely on init_logging() when driver is opend
1 parent 09ac94f commit 1ca3660

File tree

8 files changed

+0
-32
lines changed

8 files changed

+0
-32
lines changed

c/docs_structure.bzl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ dir_mapping = {
2727
"replica": "connection",
2828
"user": "connection",
2929
"database": "connection",
30-
"init_logging": "connection",
3130

3231
"session" : "session",
3332
"options": "session",
@@ -84,7 +83,6 @@ dir_mapping = {
8483
force_file = {
8584
"check_error" : "error",
8685
"get_last_error" : "error",
87-
"init_logging" : "connection",
8886

8987
"boolpromise" : "primitives",
9088
"voidpromise" : "primitives",

c/src/error.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,6 @@ thread_local! {
3434
static LAST_ERROR: RefCell<Option<Error>> = RefCell::new(None);
3535
}
3636

37-
/// Enables logging in the TypeDB driver.
38-
#[no_mangle]
39-
pub extern "C" fn init_logging() {
40-
static INIT: Once = Once::new();
41-
42-
INIT.call_once(|| {
43-
const ENV_VAR: &str = "TYPEDB_DRIVER_LOG_LEVEL";
44-
if let Err(err) = env_logger::try_init_from_env(Env::new().filter(ENV_VAR)) {
45-
warn!("Failed to initialize logging: {}", err);
46-
}
47-
});
48-
}
49-
5037
fn ok_record<T>(result: Result<T>) -> Option<T> {
5138
match result {
5239
Ok(value) => Some(value),

c/swig/typedb_driver_csharp.swg

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,6 @@
134134
}
135135
%}
136136

137-
%noexception init_logging;
138-
139137
/* simple getters do not throw */
140138
%noexception options_new;
141139
%noexception options_get_infer;

c/swig/typedb_driver_java.swg

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@
7979
}
8080
}
8181

82-
%nojavaexception init_logging;
83-
8482
%nojavaexception transaction_options_new;
8583
%nojavaexception transaction_options_get_transaction_timeout_millis;
8684
%nojavaexception transaction_options_set_transaction_timeout_millis;

c/swig/typedb_driver_python.swg

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,4 @@ static PyObject* PyExc_TypeDBDriverError;
107107

108108
%pythoncode %{
109109
TypeDBDriverExceptionNative = native_driver_python.TypeDBDriverExceptionNative
110-
111-
native_driver_python.init_logging()
112110
%}

cpp/lib/connection/driver.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ using namespace TypeDB;
2626

2727
namespace TypeDB {
2828

29-
void Driver::initLogging() {
30-
_native::init_logging();
31-
}
32-
3329
Driver Driver::coreDriver(const std::string& address) {
3430
auto p = _native::connection_open_core(address.c_str());
3531
DriverException::check_and_throw();

csharp/Common/NativeObjectWrapper.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ public abstract class NativeObjectWrapper<T>
3030
{
3131
public readonly T NativeObject;
3232

33-
static NativeObjectWrapper()
34-
{
35-
Pinvoke.typedb_driver.init_logging();
36-
}
37-
3833
protected NativeObjectWrapper(T? nativeObject)
3934
{
4035
NativeObject = nativeObject ?? throw new TypeDBDriverException(InternalError.NULL_NATIVE_VALUE);

java/common/NativeObject.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,10 @@
2222
import com.typedb.driver.common.exception.ErrorMessage;
2323
import com.typedb.driver.common.exception.TypeDBDriverException;
2424

25-
import static com.typedb.driver.jni.typedb_driver.init_logging;
2625

2726
public abstract class NativeObject<T> {
2827
static {
2928
Loader.loadNativeLibraries();
30-
init_logging();
3129
}
3230

3331
public final T nativeObject;

0 commit comments

Comments
 (0)