jinhai 94612238e5 MS-82 & MS-83 Update vecwise to Milvus
Former-commit-id: 69d1f1b661e6fc7779b4ae3abae60eeb28fa2b04
2019-06-13 16:02:25 +08:00

42 lines
1.6 KiB
C++

/*******************************************************************************
* Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved
* Unauthorized copying of this file, via any medium is strictly prohibited.
* Proprietary and confidential.
******************************************************************************/
#pragma once
#include "Error.h"
#include <easylogging++.h>
namespace zilliz {
namespace milvus {
namespace server {
#define SERVER_DOMAIN_NAME "[SERVER] "
#define SERVER_ERROR_TEXT "SERVER Error:"
#define SERVER_LOG_TRACE LOG(TRACE) << SERVER_DOMAIN_NAME
#define SERVER_LOG_DEBUG LOG(DEBUG) << SERVER_DOMAIN_NAME
#define SERVER_LOG_INFO LOG(INFO) << SERVER_DOMAIN_NAME
#define SERVER_LOG_WARNING LOG(WARNING) << SERVER_DOMAIN_NAME
#define SERVER_LOG_ERROR LOG(ERROR) << SERVER_DOMAIN_NAME
#define SERVER_LOG_FATAL LOG(FATAL) << SERVER_DOMAIN_NAME
#define SERVER_ERROR(error) \
({ \
SERVER_LOG_ERROR << SERVER_ERROR_TEXT << error; \
(error); \
})
#define SERVER_CHECK(func) \
{ \
zilliz::milvus::server::ServerError error = func; \
if (error != zilliz::milvus::server::SERVER_SUCCESS) { \
return SERVER_ERROR(error); \
} \
} \
} // namespace sql
} // namespace zilliz
} // namespace server