client/main, server/main: -L redirects log to a specified file

This commit is contained in:
Perttu Ahola 2014-10-16 08:49:17 +03:00
parent ef8237e265
commit 8f196bb0e6
2 changed files with 11 additions and 3 deletions

View File

@ -56,7 +56,7 @@ int main(int argc, char *argv[])
client::Config &config = g_client_config;
const char opts[100] = "hs:P:C:U:l:m:";
const char opts[100] = "hs:P:C:U:l:L:m:";
const char usagefmt[1000] =
"Usage: %s [OPTION]...\n"
" -h Show this help\n"
@ -64,7 +64,8 @@ int main(int argc, char *argv[])
" -P [share_path] Specify share/ path\n"
" -C [cache_path] Specify cache/ path\n"
" -U [urho3d_path] Specify Urho3D path\n"
" -l [integer] Set maximum log level (0...5)\n"
" -l [level number] Set maximum log level (0...5)\n"
" -L [log file path] Append log to a specified file\n"
" -m [name] Choose menu extension name\n"
;
@ -95,6 +96,9 @@ int main(int argc, char *argv[])
case 'l':
log_set_max_level(atoi(c55_optarg));
break;
case 'L':
log_set_file(c55_optarg);
break;
case 'm':
fprintf(stderr, "INFO: config.menu_extension_name: %s\n", c55_optarg);
config.menu_extension_name = c55_optarg;

View File

@ -76,7 +76,7 @@ int main(int argc, char *argv[])
std::string module_path;
const char opts[100] = "hm:r:i:S:U:c:l:C:";
const char opts[100] = "hm:r:i:S:U:c:l:L:C:";
const char usagefmt[1000] =
"Usage: %s [OPTION]...\n"
" -h Show this help\n"
@ -87,6 +87,7 @@ int main(int argc, char *argv[])
" -U [urho3d_path] Specify Urho3D path\n"
" -c [command] Set compiler command\n"
" -l [integer] Set maximum log level (0...5)\n"
" -L [log file path] Append log to a specified file\n"
" -C [module_name] Skip compiling specified module\n"
;
@ -125,6 +126,9 @@ int main(int argc, char *argv[])
case 'l':
log_set_max_level(atoi(c55_optarg));
break;
case 'L':
log_set_file(c55_optarg);
break;
case 'C':
fprintf(stderr, "INFO: config.skip_compiling_modules += %s\n",
c55_optarg);