提交 029d4a97 编写于 作者: H Heisenberg

MS-573 Enable log in knowhere


Former-commit-id: 7b60e5fc6edcaabea9e967ba4f3312a17533c986
上级 ad1fe081
......@@ -22,6 +22,9 @@ set(basic_libs
gomp gfortran pthread
)
set(util_srcs
${MILVUS_ENGINE_SRC}/utils/easylogging++.cc
)
#<IVF-TEST>
set(ivf_srcs
......@@ -35,7 +38,7 @@ set(ivf_srcs
utils.cpp
)
if(NOT TARGET test_ivf)
add_executable(test_ivf test_ivf.cpp ${ivf_srcs})
add_executable(test_ivf test_ivf.cpp ${ivf_srcs} ${util_srcs})
endif()
target_link_libraries(test_ivf ${depend_libs} ${unittest_libs} ${basic_libs})
......@@ -51,7 +54,7 @@ set(idmap_srcs
utils.cpp
)
if(NOT TARGET test_idmap)
add_executable(test_idmap test_idmap.cpp ${idmap_srcs})
add_executable(test_idmap test_idmap.cpp ${idmap_srcs} ${util_srcs})
endif()
target_link_libraries(test_idmap ${depend_libs} ${unittest_libs} ${basic_libs})
......@@ -68,7 +71,7 @@ set(kdt_srcs
utils.cpp
)
if(NOT TARGET test_kdt)
add_executable(test_kdt test_kdt.cpp ${kdt_srcs})
add_executable(test_kdt test_kdt.cpp ${kdt_srcs} ${util_srcs})
endif()
target_link_libraries(test_kdt
SPTAGLibStatic
......
......@@ -34,6 +34,7 @@ if(NOT TARGET test_nsg)
test_nsg.cpp
${interface_src}
${nsg_src}
${util_srcs}
)
endif()
......
......@@ -18,6 +18,15 @@
#include "utils.h"
INITIALIZE_EASYLOGGINGPP
void InitLog() {
el::Configurations defaultConf;
defaultConf.setToDefault();
defaultConf.set(el::Level::Debug,
el::ConfigurationType::Format, "[%thread-%datetime-%level]: %msg (%fbase:%line)");
el::Loggers::reconfigureLogger("default", defaultConf);
}
void DataGen::Init_with_default() {
Generate(dim, nb, nq);
......
......@@ -24,6 +24,7 @@
#include <fstream>
#include "knowhere/adapter/structure.h"
#include "knowhere/common/Log.h"
class DataGen {
protected:
......@@ -65,6 +66,8 @@ extern void GenBase(const int64_t &dim,
float *xb,
int64_t *ids);
extern void InitLog();
zilliz::knowhere::DatasetPtr
generate_dataset(int64_t nb, int64_t dim, float *xb, long *ids);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册