diff --git a/xmrstak/cli/cli-miner.cpp b/xmrstak/cli/cli-miner.cpp index 30af616a0..26a18317b 100644 --- a/xmrstak/cli/cli-miner.cpp +++ b/xmrstak/cli/cli-miner.cpp @@ -90,6 +90,7 @@ void help() cout << " --noNVIDIA disable the NVIDIA miner backend" << endl; cout << " --nvidia FILE NVIDIA backend miner config file" << endl; #endif + cout << " --log FILE miner output file" << endl; #ifndef CONF_NO_HTTPD cout << " -i --httpd HTTP_PORT HTTP interface port" << endl; #endif @@ -388,6 +389,8 @@ void do_guided_config() } configTpl.replace("HTTP_PORT", std::to_string(http_port)); + + configTpl.replace("OUTPUT_FILE", params::inst().outputFile); configTpl.write(params::inst().configFile); std::cout << "Configuration stored in file '" << params::inst().configFile << "'" << std::endl; } @@ -657,6 +660,17 @@ int main(int argc, char* argv[]) } params::inst().configFilePools = argv[i]; } + else if(opName.compare("--log") == 0) + { + ++i; + if(i >= argc) + { + printer::inst()->print_msg(L0, "No argument for parameter '--log' given"); + win_exit(); + return 1; + } + params::inst().outputFile = argv[i]; + } else if(opName.compare("-i") == 0 || opName.compare("--httpd") == 0) { ++i; diff --git a/xmrstak/config.tpl b/xmrstak/config.tpl index d8fd861a7..9edaab65f 100644 --- a/xmrstak/config.tpl +++ b/xmrstak/config.tpl @@ -129,7 +129,7 @@ R"===(// generated by XMRSTAK_VERSION * output_file - This option will log all output to a file. * */ -"output_file" : "", +"output_file" : "OUTPUT_FILE", /* * Built-in web server diff --git a/xmrstak/jconf.cpp b/xmrstak/jconf.cpp index 10082a09f..2bc5205bc 100644 --- a/xmrstak/jconf.cpp +++ b/xmrstak/jconf.cpp @@ -283,7 +283,10 @@ bool jconf::DaemonMode() const char* jconf::GetOutputFile() { - return prv->configValues[sOutputFile]->GetString(); + if(xmrstak::params::inst().outputFile.length() > 0) + return xmrstak::params::inst().outputFile.c_str(); + else + return prv->configValues[sOutputFile]->GetString(); } void jconf::cpuid(uint32_t eax, int32_t ecx, int32_t val[4]) diff --git a/xmrstak/params.hpp b/xmrstak/params.hpp index a00e51b0a..9fc3b57b8 100644 --- a/xmrstak/params.hpp +++ b/xmrstak/params.hpp @@ -50,6 +50,8 @@ struct params std::string configFileNVIDIA; std::string configFileCPU; + std::string outputFile; + bool allowUAC = true; std::string minerArg0; std::string minerArgs;