-
Notifications
You must be signed in to change notification settings - Fork 138
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
Fix: create log folder before logging #1200
Conversation
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); |
There was a problem hiding this comment.
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
…janhq/cortex.cpp into fix/create-log-folder-if-didn't-existed
There was a problem hiding this 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
Fix #1198
Summary changes: