@@ -143,7 +143,7 @@ bool ReplaceBinaryInflight(const std::filesystem::path& src,
143143 // Get permissions of the executable file
144144 struct stat dst_file_stat;
145145 if (stat (dst.string ().c_str (), &dst_file_stat) != 0 ) {
146- CTL_ERR (" Error getting permissions of executable file: " << dst.string ());
146+ CLI_LOG_ERROR (" Error getting permissions of executable file: " << dst.string ());
147147 return false ;
148148 }
149149
@@ -159,28 +159,28 @@ bool ReplaceBinaryInflight(const std::filesystem::path& src,
159159#if !defined(_WIN32)
160160 // Set permissions of the executable file
161161 if (chmod (dst.string ().c_str (), dst_file_stat.st_mode ) != 0 ) {
162- CTL_ERR (" Error setting permissions of executable file: " << dst.string ());
162+ CLI_LOG_ERROR (" Error setting permissions of executable file: " << dst.string ());
163163 restore_binary ();
164164 return false ;
165165 }
166166
167167 // Set owner and group of the executable file
168168 if (chown (dst.string ().c_str (), dst_file_owner, dst_file_group) != 0 ) {
169- CTL_ERR (
169+ CLI_LOG_ERROR (
170170 " Error setting owner and group of executable file: " << dst.string ());
171171 restore_binary ();
172172 return false ;
173173 }
174174
175175 // Remove cortex_temp
176176 if (unlink (temp.string ().c_str ()) != 0 ) {
177- CTL_ERR (" Error deleting self: " << strerror (errno));
177+ CLI_LOG_ERROR (" Error deleting self: " << strerror (errno));
178178 restore_binary ();
179179 return false ;
180180 }
181181#endif
182182 } catch (const std::exception& e) {
183- CTL_ERR (" Something went wrong: " << e.what ());
183+ CLI_LOG_ERROR (" Something went wrong: " << e.what ());
184184 restore_binary ();
185185 return false ;
186186 }
@@ -254,16 +254,16 @@ bool CortexUpdCmd::GetStable(const std::string& v) {
254254 return false ;
255255 }
256256 } catch (const nlohmann::json::parse_error& e) {
257- CTL_ERR (" JSON parse error: " << e.what ());
257+ CLI_LOG_ERROR (" JSON parse error: " << e.what ());
258258 return false ;
259259 }
260260 } else {
261- CTL_ERR (" HTTP error: " << res->status );
261+ CLI_LOG_ERROR (" HTTP error: " << res->status );
262262 return false ;
263263 }
264264 } else {
265265 auto err = res.error ();
266- CTL_ERR (" HTTP error: " << httplib::to_string (err));
266+ CLI_LOG_ERROR (" HTTP error: " << httplib::to_string (err));
267267 return false ;
268268 }
269269
@@ -320,16 +320,16 @@ bool CortexUpdCmd::GetBeta(const std::string& v) {
320320 return false ;
321321 }
322322 } catch (const nlohmann::json::parse_error& e) {
323- CTL_ERR (" JSON parse error: " << e.what ());
323+ CLI_LOG_ERROR (" JSON parse error: " << e.what ());
324324 return false ;
325325 }
326326 } else {
327- CTL_ERR (" HTTP error: " << res->status );
327+ CLI_LOG_ERROR (" HTTP error: " << res->status );
328328 return false ;
329329 }
330330 } else {
331331 auto err = res.error ();
332- CTL_ERR (" HTTP error: " << httplib::to_string (err));
332+ CLI_LOG_ERROR (" HTTP error: " << httplib::to_string (err));
333333 return false ;
334334 }
335335
@@ -364,7 +364,7 @@ bool CortexUpdCmd::HandleGithubRelease(const nlohmann::json& assets,
364364 CTL_INF (asset_name);
365365 }
366366 if (matched_variant.empty ()) {
367- CTL_ERR (" No variant found for " << os_arch);
367+ CLI_LOG_ERROR (" No variant found for " << os_arch);
368368 return false ;
369369 }
370370 CTL_INF (" Matched variant: " << matched_variant);
@@ -383,7 +383,7 @@ bool CortexUpdCmd::HandleGithubRelease(const nlohmann::json& assets,
383383 std::filesystem::create_directories (local_path.parent_path ());
384384 }
385385 } catch (const std::filesystem::filesystem_error& e) {
386- CTL_ERR (" Failed to create directories: " << e.what ());
386+ CLI_LOG_ERROR (" Failed to create directories: " << e.what ());
387387 return false ;
388388 }
389389 auto download_task{DownloadTask{.id = " cortex" ,
@@ -410,7 +410,7 @@ bool CortexUpdCmd::HandleGithubRelease(const nlohmann::json& assets,
410410 CTL_INF (" Finished!" );
411411 });
412412 if (result.has_error ()) {
413- CTL_ERR (" Failed to download: " << result.error ());
413+ CLI_LOG_ERROR (" Failed to download: " << result.error ());
414414 }
415415 break ;
416416 }
@@ -447,7 +447,7 @@ bool CortexUpdCmd::GetNightly(const std::string& v) {
447447 std::filesystem::create_directories (localPath.parent_path ());
448448 }
449449 } catch (const std::filesystem::filesystem_error& e) {
450- CTL_ERR (" Failed to create directories: " << e.what ());
450+ CLI_LOG_ERROR (" Failed to create directories: " << e.what ());
451451 return false ;
452452 }
453453 auto download_task =
@@ -474,7 +474,7 @@ bool CortexUpdCmd::GetNightly(const std::string& v) {
474474 CTL_INF (" Finished!" );
475475 });
476476 if (result.has_error ()) {
477- CTL_ERR (" Failed to download: " << result.error ());
477+ CLI_LOG_ERROR (" Failed to download: " << result.error ());
478478 return false ;
479479 }
480480
0 commit comments