@@ -26,7 +26,14 @@ bool TryConnectToServer(const std::string& host, int port) {
2626
2727ServerStartCmd::ServerStartCmd () {}
2828
29- bool ServerStartCmd::Exec (const std::string& host, int port) {
29+ bool ServerStartCmd::Exec (const std::string& host, int port,
30+ const std::optional<std::string>& log_level) {
31+ std::string log_level_;
32+ if (!log_level.has_value ()) {
33+ log_level_ = " INFO" ;
34+ } else {
35+ log_level_ = log_level.value ();
36+ }
3037 auto exe = commands::GetCortexServerBinary ();
3138 auto get_config_file_path = []() -> std::string {
3239 if (file_manager_utils::cortex_config_file_path.empty ()) {
@@ -53,6 +60,7 @@ bool ServerStartCmd::Exec(const std::string& host, int port) {
5360 std::string params = " --start-server" ;
5461 params += " --config_file_path " + get_config_file_path ();
5562 params += " --data_folder_path " + get_data_folder_path ();
63+ params += " --loglevel " + log_level_;
5664 std::string cmds = cortex_utils::GetCurrentPath () + " /" + exe + " " + params;
5765 // Create child process
5866 if (!CreateProcess (
@@ -107,7 +115,7 @@ bool ServerStartCmd::Exec(const std::string& host, int port) {
107115 std::string p = cortex_utils::GetCurrentPath () + " /" + exe;
108116 execl (p.c_str (), exe.c_str (), " --start-server" , " --config_file_path" ,
109117 get_config_file_path ().c_str (), " --data_folder_path" ,
110- get_data_folder_path ().c_str (), (char *)0 );
118+ get_data_folder_path ().c_str (), " --loglevel " , log_level_. c_str (), (char *)0 );
111119 } else {
112120 // Parent process
113121 if (!TryConnectToServer (host, port)) {
0 commit comments