Changed output_file to output_folder

pull/286/head^2
FlightlessMango 4 years ago
parent 8a39043a13
commit ac85815d82

@ -7,6 +7,8 @@
#include "file_utils.h"
#include "string_utils.h"
std::string program_name;
void parseConfigLine(std::string line, std::unordered_map<std::string,std::string>& options) {
std::string param, value;
@ -41,6 +43,7 @@ void enumerate_config_files(std::vector<std::string>& paths)
if (!exe_path.empty() && n != std::string::npos && n < exe_path.size() - 1) {
// as executable's name
std::string basename = exe_path.substr(n + 1);
program_name = basename;
if (!env_config.empty())
paths.push_back(env_config + mangohud_dir + basename + ".conf");
@ -49,12 +52,16 @@ void enumerate_config_files(std::vector<std::string>& paths)
// find executable's path when run in Wine
if (!env_config.empty() && (basename == "wine-preloader" || basename == "wine64-preloader")) {
std::string name;
if (get_wine_exe_name(name)) {
paths.push_back(env_config + mangohud_dir + "wine-" + name + ".conf");
}
program_name = name;
}
}
if (program_name.empty())
program_name = "Unknown";
}
void parseConfigFile(overlay_params& params) {

@ -4,5 +4,5 @@
#include "overlay_params.h"
void parseConfigFile(overlay_params& p);
extern std::string program_name;
#endif //MANGOHUD_CONFIG_H

@ -1,5 +1,6 @@
#include "logging.h"
#include "overlay.h"
#include "config.h"
#include <sstream>
#include <iomanip>
@ -109,7 +110,7 @@ void Logger::start_logging() {
m_values_valid = false;
m_logging_on = true;
m_log_start = Clock::now();
if((not m_params->output_file.empty()) and (m_params->log_interval != 0)){
if((not m_params->output_folder.empty()) and (m_params->log_interval != 0)){
std::thread(logging, m_params).detach();
}
}
@ -121,8 +122,8 @@ void Logger::stop_logging() {
std::thread(calculate_benchmark_data, m_params).detach();
if(not m_params->output_file.empty()) {
m_log_files.emplace_back(m_params->output_file + get_log_suffix());
if(not m_params->output_folder.empty()) {
m_log_files.emplace_back(m_params->output_folder + "/" + program_name + "_" + get_log_suffix());
std::thread(writeFile, m_log_files.back()).detach();
}
}

@ -292,7 +292,7 @@ parse_font_glyph_ranges(const char *str)
#define parse_offset_y(s) parse_unsigned(s)
#define parse_log_duration(s) parse_unsigned(s)
#define parse_time_format(s) parse_str(s)
#define parse_output_file(s) parse_path(s)
#define parse_output_folder(s) parse_path(s)
#define parse_font_file(s) parse_path(s)
#define parse_font_file_text(s) parse_path(s)
#define parse_io_read(s) parse_unsigned(s)
@ -335,7 +335,7 @@ parse_help(const char *str)
fprintf(stderr, "\tposition=top-left|top-right|bottom-left|bottom-right\n");
fprintf(stderr, "\tfps_sampling_period=number-of-milliseconds\n");
fprintf(stderr, "\tno_display=0|1\n");
fprintf(stderr, "\toutput_file=/path/to/output.txt\n");
fprintf(stderr, "\toutput_folder=/path/to/folder\n");
fprintf(stderr, "\twidth=width-in-pixels\n");
fprintf(stderr, "\theight=height-in-pixels\n");

@ -50,7 +50,7 @@ typedef unsigned long KeySym;
OVERLAY_PARAM_BOOL(engine_version) \
OVERLAY_PARAM_BOOL(histogram) \
OVERLAY_PARAM_CUSTOM(fps_sampling_period) \
OVERLAY_PARAM_CUSTOM(output_file) \
OVERLAY_PARAM_CUSTOM(output_folder) \
OVERLAY_PARAM_CUSTOM(font_file) \
OVERLAY_PARAM_CUSTOM(font_file_text) \
OVERLAY_PARAM_CUSTOM(font_glyph_ranges) \
@ -169,7 +169,7 @@ struct overlay_params {
std::vector<KeySym> reload_cfg;
std::vector<KeySym> upload_log;
std::vector<KeySym> upload_logs;
std::string time_format, output_file;
std::string time_format, output_folder;
std::string pci_dev;
std::string media_player_name;
std::string cpu_text, gpu_text;

Loading…
Cancel
Save