Skip to content

Commit

Permalink
fix logging issue
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyoyuppe committed Oct 13, 2020
1 parent 9ae3efa commit d2913bc
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,14 @@ void LogToFile(std::string what, const bool verbose)
std::lock_guard lock{ logMutex };
std::wstring logFilePath = tempPath;
logFilePath += L"\\PowerToysVideoConference.log";
const size_t logSizeMBs = std::filesystem::file_size(logFilePath) >> 20;
size_t logSizeMBs = 0;
try
{
logSizeMBs = std::filesystem::file_size(logFilePath) >> 20;
}
catch(...)
{
}
if (logSizeMBs > maxLogSizeMegabytes)
{
std::error_code _;
Expand Down

0 comments on commit d2913bc

Please sign in to comment.