milvus/cpp/src/utils/LogUtil.h
Heisenberg 785a75a121 MS-552 Add and change the easylogging library
Former-commit-id: cc29d15a956a343622f1f17c63b1ada51bb172a5
2019-09-16 20:08:46 +08:00

32 lines
943 B
C++

/*******************************************************************************
* Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved
* Unauthorized copying of this file, via any medium is strictly prohibited.
* Proprietary and confidential.
******************************************************************************/
#pragma once
#include <string>
#include <sstream>
#include "easylogging++.h"
namespace zilliz {
namespace milvus {
namespace server {
int32_t InitLog(const std::string& log_config_file);
inline std::string GetFileName(std::string filename) {
int pos = filename.find_last_of('/');
return filename.substr(pos + 1);
}
void RolloutHandler(const char *filename, std::size_t size, el::Level level);
#define SHOW_LOCATION
#ifdef SHOW_LOCATION
#define LOCATION_INFO "[" << zilliz::sql::server::GetFileName(__FILE__) << ":" << __LINE__ << "] "
#else
#define LOCATION_INFO ""
#endif
}
}
}