update documentation and move condition to top

thanks to stevecotton for the documentation message for no-log-sanitize
This commit is contained in:
Subhraman Sarkar 2024-07-10 09:12:39 +05:30 committed by Steve Cotton
parent 8166ab25ab
commit 815a4379e6
2 changed files with 4 additions and 3 deletions

View file

@ -238,8 +238,8 @@ commandline_options::commandline_options(const std::vector<std::string>& args)
("log-none", po::value<std::vector<std::string>>()->composing(), "sets the severity level of the specified log domain(s) to 'none'. Similar to --log-error.")
("log-precise", "shows the timestamps in log output with more precision.")
("no-log-to-file", "log output is written only to standard error rather than to a file. The environment variable WESNOTH_NO_LOG_FILE can also be set as an alternative.")
("log-to-file", "log output is written to a file. Cancels the effect of --no-log-to-file whether implicit or explicit.")
("no-log-sanitize", "do not sanitize usernames in log")
("log-to-file", "log output is written to the log file instead of standard error. Cancels the effect of --no-log-to-file whether implicit or explicit.")
("no-log-sanitize", "disables the anonymization that's normally applied when logging, for example replacing usernames with “USER”")
("wnoconsole", "For Windows, when used with --no-log-to-file, results in output being written to cerr/cout instead of CONOUT. Otherwise, does nothing.")
;

View file

@ -440,10 +440,11 @@ void set_log_sanitize(bool sanitize) {
std::string sanitize_log(const std::string& logstr)
{
std::string str = logstr;
if (!log_sanitization) {
return logstr;
}
std::string str = logstr;
#ifdef _WIN32
const char* user_name = getenv("USERNAME");