server tweak
This commit is contained in:
parent
13d0948fdc
commit
b47525df0a
2 changed files with 6 additions and 4 deletions
|
@ -2516,13 +2516,13 @@ static void server_params_parse(int argc, char **argv, server_params &sparams,
|
||||||
{
|
{
|
||||||
llama.skvgraphics = true; // -skvg takes no parameter so we don't test ++i >= argc
|
llama.skvgraphics = true; // -skvg takes no parameter so we don't test ++i >= argc
|
||||||
llama.skvinteract = false;
|
llama.skvinteract = false;
|
||||||
log_settings.stdout_target = "/dev/null";
|
//log_settings.stdout_target = "/dev/null"; prevent stdout from interfering with the graphics display
|
||||||
}
|
}
|
||||||
else if (arg == "-skvi" || arg == "--show-interactive-graphics")
|
else if (arg == "-skvi" || arg == "--show-interactive-graphics")
|
||||||
{
|
{
|
||||||
llama.skvgraphics = true; // -skvi takes no parameter so we don't test ++i >= argc
|
llama.skvgraphics = true; // -skvi takes no parameter so we don't test ++i >= argc
|
||||||
llama.skvinteract = true;
|
llama.skvinteract = true;
|
||||||
log_settings.stdout_target = "/dev/null";
|
//log_settings.stdout_target = "/dev/null";
|
||||||
}
|
}
|
||||||
else if (arg == "--gpu-layers" || arg == "-ngl" || arg == "--n-gpu-layers")
|
else if (arg == "--gpu-layers" || arg == "-ngl" || arg == "--n-gpu-layers")
|
||||||
{
|
{
|
||||||
|
@ -2762,14 +2762,14 @@ static void server_params_parse(int argc, char **argv, server_params &sparams,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (arg == "--stdout-log-file")
|
else if (arg == "--stdout-log-file") // redirect the stdout logging to a specified file
|
||||||
{
|
{
|
||||||
if (++i >= argc)
|
if (++i >= argc)
|
||||||
{
|
{
|
||||||
invalid_param = true;
|
invalid_param = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
log_settings.stdout_target = argv[i]; // have just noticed that there is a 'log_set_target()' below but says 'INTERNAL USE: DO NOT USE'
|
log_settings.stdout_target = argv[i]; // there is a 'log_set_target()' below but says 'INTERNAL USE: DO NOT USE'
|
||||||
}
|
}
|
||||||
else if (arg == "--log-disable")
|
else if (arg == "--log-disable")
|
||||||
{
|
{
|
||||||
|
|
|
@ -215,6 +215,8 @@ static inline void server_log(
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
// to allow the graphics to print to stdout we redirect non-graphical stdout to stderr
|
||||||
|
// to silence the graphics we direct stdout to dev/null or just don't invoke them
|
||||||
std::cerr << stdout_target.c_str() << std::endl;
|
std::cerr << stdout_target.c_str() << std::endl;
|
||||||
FILE* new_stdout = freopen(stdout_target.c_str(), "a", stdout);
|
FILE* new_stdout = freopen(stdout_target.c_str(), "a", stdout);
|
||||||
if (new_stdout == nullptr) {
|
if (new_stdout == nullptr) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue