Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: create log folder before logging #1200

Merged
merged 9 commits into from
Sep 13, 2024

Conversation

nguyenhoangthuan99
Copy link
Contributor

@nguyenhoangthuan99 nguyenhoangthuan99 commented Sep 12, 2024

Fix #1198
Summary changes:

  • Add end to end test for start server
  • Add end to end test for create log folder after server started

@nguyenhoangthuan99 nguyenhoangthuan99 changed the title Fix create log folder before logging Fix: create log folder before logging Sep 12, 2024
@nguyenhoangthuan99 nguyenhoangthuan99 marked this pull request as ready for review September 12, 2024 09:06
engine/main.cc Outdated
@@ -31,6 +31,7 @@ void RunServer() {
<< " Port: " << config.apiServerPort << "\n";

// Create logs/ folder and setup log to file
std::filesystem::create_directory(config.logFolderPath);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using std::filesystem::create_directories should be better. Seems like it handle create directory recursively.
https://en.cppreference.com/w/cpp/filesystem/create_directory

Also, I'm worry about concatenate path using / might not work on windows. Should using std::filesystem::path

Copy link
Contributor

@dan-homebrew dan-homebrew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nguyenhoangthuan99 Approved to unblock. However:

  • Please add tests!
  • This is the sort of thing that an intern will not realize, remove folder creation, and end up bricking the entire product

@nguyenhoangthuan99 nguyenhoangthuan99 merged commit 82f7823 into dev Sep 13, 2024
4 checks passed
@nguyenhoangthuan99 nguyenhoangthuan99 deleted the fix/create-log-folder-if-didn't-existed branch September 13, 2024 01:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: cortex-nightly unable to run on first install
4 participants