print warning on stdout (#2243)

* print warning on stdout

Signed-off-by: wxyu <xy.wang@zilliz.com>

* update

Signed-off-by: wxyu <xy.wang@zilliz.com>

* fix compile failed

Signed-off-by: wxyu <xy.wang@zilliz.com>
This commit is contained in:
Wang XiangYu 2020-05-08 16:57:08 +08:00 committed by GitHub
parent 8a68d34919
commit 104cda1a76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -159,6 +159,14 @@ Server::Start() {
Config& config = Config::GetInstance();
std::string meta_uri;
CONFIG_CHECK(config.GetDBConfigBackendUrl(meta_uri));
if (meta_uri.length() > 6 && strcasecmp("sqlite", meta_uri.substr(0, 6).c_str()) == 0) {
std::cout << "WARNNING: You are using SQLite as the meta data management, "
"which can't be used in production. Please change it to MySQL!"
<< std::endl;
}
/* Init opentracing tracer from config */
std::string tracing_config_path;
s = config.GetTracingConfigJsonConfigPath(tracing_config_path);
@ -201,42 +209,15 @@ Server::Start() {
std::string logs_path;
int64_t max_log_file_size = 0;
int64_t delete_exceeds = 0;
s = config.GetLogsTraceEnable(trace_enable);
if (!s.ok()) {
return s;
}
s = config.GetLogsDebugEnable(debug_enable);
if (!s.ok()) {
return s;
}
s = config.GetLogsInfoEnable(info_enable);
if (!s.ok()) {
return s;
}
s = config.GetLogsWarningEnable(warning_enable);
if (!s.ok()) {
return s;
}
s = config.GetLogsErrorEnable(error_enable);
if (!s.ok()) {
return s;
}
s = config.GetLogsFatalEnable(fatal_enable);
if (!s.ok()) {
return s;
}
s = config.GetLogsPath(logs_path);
if (!s.ok()) {
return s;
}
s = config.GetLogsMaxLogFileSize(max_log_file_size);
if (!s.ok()) {
return s;
}
s = config.GetLogsDeleteExceeds(delete_exceeds);
if (!s.ok()) {
return s;
}
CONFIG_CHECK(config.GetLogsTraceEnable(trace_enable));
CONFIG_CHECK(config.GetLogsDebugEnable(debug_enable));
CONFIG_CHECK(config.GetLogsInfoEnable(info_enable));
CONFIG_CHECK(config.GetLogsWarningEnable(warning_enable));
CONFIG_CHECK(config.GetLogsErrorEnable(error_enable));
CONFIG_CHECK(config.GetLogsFatalEnable(fatal_enable));
CONFIG_CHECK(config.GetLogsPath(logs_path));
CONFIG_CHECK(config.GetLogsMaxLogFileSize(max_log_file_size));
CONFIG_CHECK(config.GetLogsDeleteExceeds(delete_exceeds));
InitLog(trace_enable, debug_enable, info_enable, warning_enable, error_enable, fatal_enable, logs_path,
max_log_file_size, delete_exceeds);
}