Update to fix duplicate stdout log output (#1054)
Disables default log output to stdout if stdout is set as logfile. When execute `turnutils_stunclient` , the output will be duplicated as in the following example. ``` $ ./turnutils_stunclient stun.example.com 0: : IPv4. UDP reflexive addr: 203.0.113.1:10000 0: : IPv4. UDP reflexive addr: 203.0.113.1:10000 ``` This is because stdout is set in `set_logfile` and furthermore log output to stdout is done by default. In this change, call `set_no_stdout_log` to disable default log output to stdout when stdout is set as logfile. This solves the problem of duplicate output to stdout of the same log.
This commit is contained in:
parent
ae134d84e8
commit
9a9e9671f4
@ -634,6 +634,7 @@ int main(int argc, char **argv)
|
||||
if (socket_init()) return -1;
|
||||
|
||||
set_logfile("stdout");
|
||||
set_no_stdout_log(1);
|
||||
set_system_parameters(0);
|
||||
|
||||
memset(local_addr_string, 0, sizeof(local_addr_string));
|
||||
|
||||
@ -275,6 +275,7 @@ int main(int argc, char **argv)
|
||||
int c=0;
|
||||
|
||||
set_logfile("stdout");
|
||||
set_no_stdout_log(1);
|
||||
set_system_parameters(0);
|
||||
|
||||
while ((c = getopt_long(argc, argv, "hvedi:j:k:l:m:n:o:p:q:r:t:u:",long_options, &option_index)) != -1) {
|
||||
|
||||
@ -69,6 +69,7 @@ int main(int argc, char **argv)
|
||||
IS_TURN_SERVER = 1;
|
||||
|
||||
set_logfile("stdout");
|
||||
set_no_stdout_log(1);
|
||||
set_system_parameters(0);
|
||||
|
||||
while ((c = getopt(argc, argv, "d:p:L:v")) != -1)
|
||||
|
||||
@ -218,6 +218,7 @@ int main(int argc, const char **argv)
|
||||
print_extra = 1;
|
||||
|
||||
set_logfile("stdout");
|
||||
set_no_stdout_log(1);
|
||||
set_system_parameters(0);
|
||||
|
||||
{
|
||||
|
||||
@ -424,6 +424,7 @@ int main(int argc, char **argv)
|
||||
if (socket_init()) return -1;
|
||||
|
||||
set_logfile("stdout");
|
||||
set_no_stdout_log(1);
|
||||
set_system_parameters(0);
|
||||
|
||||
memset(local_addr, 0, sizeof(local_addr));
|
||||
|
||||
@ -191,6 +191,7 @@ int main(int argc, char **argv)
|
||||
#endif
|
||||
|
||||
set_logfile("stdout");
|
||||
set_no_stdout_log(1);
|
||||
|
||||
set_execdir();
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user