Additional logging + FFMpeg changes; ffmpeg output will be in the log now

This commit is contained in:
2025-08-15 18:03:45 -04:00
parent 8388fd5d99
commit afbaf2bc65
6 changed files with 43 additions and 12 deletions

View File

@@ -2,7 +2,12 @@
inline std::ofstream logFile;
static void _log_write(const std::string& string)
std::string log_path_get(void)
{
return preferences_path_get() + LOG_PATH;
}
void log_write(const std::string& string)
{
std::println("{}", string);
@@ -13,30 +18,36 @@ static void _log_write(const std::string& string)
}
}
void log_init(const std::string& file)
void log_init(void)
{
logFile.open(file, std::ios::out | std::ios::trunc);
if (!logFile) std::println("{}", std::format(LOG_INIT_ERROR, file));
std::string logFilepath = log_path_get();
logFile.open(logFilepath, std::ios::out | std::ios::trunc);
if (!logFile) std::println("{}", std::format(LOG_INIT_ERROR, logFilepath));
}
void log_error(const std::string& error)
{
_log_write(LOG_ERROR_FORMAT + error);
log_write(LOG_ERROR_FORMAT + error);
}
void log_info(const std::string& info)
{
_log_write(LOG_INFO_FORMAT + info);
log_write(LOG_INFO_FORMAT + info);
}
void log_warning(const std::string& warning)
{
_log_write(LOG_WARNING_FORMAT + warning);
log_write(LOG_WARNING_FORMAT + warning);
}
void log_imgui(const std::string& imgui)
{
_log_write(LOG_IMGUI_FORMAT + imgui);
log_write(LOG_IMGUI_FORMAT + imgui);
}
void log_command(const std::string& command)
{
log_write(LOG_COMMAND_FORMAT + command);
}
void log_free(void)