mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-06 17:18:35 +08:00
Make C++ log level configurable and add log configuration while building embedded milvus. (#15743)
Signed-off-by: Yuchen Gao <yuchen.gao@zilliz.com>
This commit is contained in:
parent
26544fb77f
commit
a77e0562b2
@ -9,6 +9,11 @@
|
|||||||
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||||
# or implied. See the License for the specific language governing permissions and limitations under the License
|
# or implied. See the License for the specific language governing permissions and limitations under the License
|
||||||
|
|
||||||
|
option( EMBEDDED_MILVUS "Enable embedded Milvus" OFF )
|
||||||
|
|
||||||
|
if ( EMBEDDED_MILVUS )
|
||||||
|
add_compile_definitions( "-DEMBEDDED_MILVUS" )
|
||||||
|
endif()
|
||||||
|
|
||||||
set(SEGCORE_FILES
|
set(SEGCORE_FILES
|
||||||
Collection.cpp
|
Collection.cpp
|
||||||
|
|||||||
@ -18,6 +18,18 @@ namespace milvus::segcore {
|
|||||||
extern "C" void
|
extern "C" void
|
||||||
SegcoreInit() {
|
SegcoreInit() {
|
||||||
milvus::config::KnowhereInitImpl();
|
milvus::config::KnowhereInitImpl();
|
||||||
|
#if defined(EMBEDDED_MILVUS)
|
||||||
|
el::Configurations defaultConf;
|
||||||
|
defaultConf.setToDefault();
|
||||||
|
// Disable all logs for embedded milvus.
|
||||||
|
defaultConf.set(el::Level::Trace, el::ConfigurationType::Enabled, "false");
|
||||||
|
defaultConf.set(el::Level::Debug, el::ConfigurationType::Enabled, "false");
|
||||||
|
defaultConf.set(el::Level::Info, el::ConfigurationType::Enabled, "false");
|
||||||
|
defaultConf.set(el::Level::Warning, el::ConfigurationType::Enabled, "false");
|
||||||
|
defaultConf.set(el::Level::Error, el::ConfigurationType::Enabled, "false");
|
||||||
|
defaultConf.set(el::Level::Fatal, el::ConfigurationType::Enabled, "false");
|
||||||
|
el::Loggers::reconfigureLogger("default", defaultConf);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" void
|
extern "C" void
|
||||||
|
|||||||
@ -55,8 +55,9 @@ GPU_VERSION="OFF" #defaults to CPU version
|
|||||||
WITH_PROMETHEUS="ON"
|
WITH_PROMETHEUS="ON"
|
||||||
CUDA_ARCH="DEFAULT"
|
CUDA_ARCH="DEFAULT"
|
||||||
CUSTOM_THIRDPARTY_PATH=""
|
CUSTOM_THIRDPARTY_PATH=""
|
||||||
|
EMBEDDED_MILVUS="OFF"
|
||||||
|
|
||||||
while getopts "p:d:t:s:f:ulrcghzme" arg; do
|
while getopts "p:d:t:s:f:ulrcghzmeb" arg; do
|
||||||
case $arg in
|
case $arg in
|
||||||
f)
|
f)
|
||||||
CUSTOM_THIRDPARTY_PATH=$OPTARG
|
CUSTOM_THIRDPARTY_PATH=$OPTARG
|
||||||
@ -97,6 +98,9 @@ while getopts "p:d:t:s:f:ulrcghzme" arg; do
|
|||||||
s)
|
s)
|
||||||
CUDA_ARCH=$OPTARG
|
CUDA_ARCH=$OPTARG
|
||||||
;;
|
;;
|
||||||
|
b)
|
||||||
|
EMBEDDED_MILVUS=$OPTARG
|
||||||
|
;;
|
||||||
h) # help
|
h) # help
|
||||||
echo "
|
echo "
|
||||||
|
|
||||||
@ -113,10 +117,11 @@ parameter:
|
|||||||
-g: build GPU version(default: OFF)
|
-g: build GPU version(default: OFF)
|
||||||
-e: build without prometheus(default: OFF)
|
-e: build without prometheus(default: OFF)
|
||||||
-s: build with CUDA arch(default:DEFAULT), for example '-gencode=compute_61,code=sm_61;-gencode=compute_75,code=sm_75'
|
-s: build with CUDA arch(default:DEFAULT), for example '-gencode=compute_61,code=sm_61;-gencode=compute_75,code=sm_75'
|
||||||
|
-b: build embedded milvus(default: OFF)
|
||||||
-h: help
|
-h: help
|
||||||
|
|
||||||
usage:
|
usage:
|
||||||
./core_build.sh -p \${INSTALL_PREFIX} -t \${BUILD_TYPE} -s \${CUDA_ARCH} -f\${CUSTOM_THIRDPARTY_PATH} [-u] [-l] [-r] [-c] [-z] [-g] [-m] [-e] [-h]
|
./core_build.sh -p \${INSTALL_PREFIX} -t \${BUILD_TYPE} -s \${CUDA_ARCH} -f\${CUSTOM_THIRDPARTY_PATH} [-u] [-l] [-r] [-c] [-z] [-g] [-m] [-e] [-h] [-b]
|
||||||
"
|
"
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
@ -171,6 +176,7 @@ CMAKE_CMD="cmake \
|
|||||||
-DMILVUS_WITH_PROMETHEUS=${WITH_PROMETHEUS} \
|
-DMILVUS_WITH_PROMETHEUS=${WITH_PROMETHEUS} \
|
||||||
-DMILVUS_CUDA_ARCH=${CUDA_ARCH} \
|
-DMILVUS_CUDA_ARCH=${CUDA_ARCH} \
|
||||||
-DCUSTOM_THIRDPARTY_DOWNLOAD_PATH=${CUSTOM_THIRDPARTY_PATH} \
|
-DCUSTOM_THIRDPARTY_DOWNLOAD_PATH=${CUSTOM_THIRDPARTY_PATH} \
|
||||||
|
-DEMBEDDED_MILVUS=${EMBEDDED_MILVUS} \
|
||||||
${CPP_SRC_DIR}"
|
${CPP_SRC_DIR}"
|
||||||
echo ${CMAKE_CMD}
|
echo ${CMAKE_CMD}
|
||||||
${CMAKE_CMD}
|
${CMAKE_CMD}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user