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
#1653: Create a log file and add it to crash report. #1657
Conversation
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.
Looks good, I'm just wondering if there needs to be some code to enure the parent directory of logFilePath()
is created (I tested on macOS only.)
|
||
namespace TrenchBroom { | ||
FileLogger::FileLogger(const IO::Path& filePath) : | ||
m_file(std::fopen(filePath.asString().c_str(), "w")) {} |
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.
Throw an exception in the constructor if fopen
returns null?
} | ||
|
||
FileLogger& FileLogger::instance() { | ||
static FileLogger Instance(IO::SystemPaths::logFilePath()); |
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.
I don't see where the parent directory of IO::SystemPaths::logFilePath()
is created, is that a potential problem?
Testing on macOS, I tried deleting ~/Library/Application Support/TrenchBroom
and then launching TB, and the TrenchBroom
directory was created and everything worked.
Implemented all suggested changes. |
Closes #1653. Also touched up the crash dialog a bit.