mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 10:03:45 +01:00
--logfile '' = no logging
This commit is contained in:
parent
f79082a46d
commit
3da05a09b5
16
src/main.cpp
16
src/main.cpp
@ -781,7 +781,7 @@ int main(int argc, char *argv[])
|
|||||||
allowed_options.insert("verbose", ValueSpec(VALUETYPE_FLAG,
|
allowed_options.insert("verbose", ValueSpec(VALUETYPE_FLAG,
|
||||||
"Print more information to console"));
|
"Print more information to console"));
|
||||||
allowed_options.insert("logfile", ValueSpec(VALUETYPE_STRING,
|
allowed_options.insert("logfile", ValueSpec(VALUETYPE_STRING,
|
||||||
"Set logfile path (debug.txt)"));
|
"Set logfile path ('' = no logging)"));
|
||||||
allowed_options.insert("gameid", ValueSpec(VALUETYPE_STRING,
|
allowed_options.insert("gameid", ValueSpec(VALUETYPE_STRING,
|
||||||
"Set gameid (\"--gameid list\" prints available ones)"));
|
"Set gameid (\"--gameid list\" prints available ones)"));
|
||||||
#ifndef SERVER
|
#ifndef SERVER
|
||||||
@ -854,17 +854,19 @@ int main(int argc, char *argv[])
|
|||||||
#endif
|
#endif
|
||||||
if(cmd_args.exists("logfile"))
|
if(cmd_args.exists("logfile"))
|
||||||
logfile = cmd_args.get("logfile");
|
logfile = cmd_args.get("logfile");
|
||||||
bool disable_stderr = false;
|
if(logfile != "")
|
||||||
debugstreams_init(disable_stderr, logfile.c_str());
|
debugstreams_init(false, logfile.c_str());
|
||||||
// Initialize debug stacks
|
else
|
||||||
debug_stacks_init();
|
debugstreams_init(false, NULL);
|
||||||
|
|
||||||
DSTACK(__FUNCTION_NAME);
|
|
||||||
|
|
||||||
infostream<<"logfile = "<<logfile<<std::endl;
|
infostream<<"logfile = "<<logfile<<std::endl;
|
||||||
infostream<<"path_share = "<<porting::path_share<<std::endl;
|
infostream<<"path_share = "<<porting::path_share<<std::endl;
|
||||||
infostream<<"path_user = "<<porting::path_user<<std::endl;
|
infostream<<"path_user = "<<porting::path_user<<std::endl;
|
||||||
|
|
||||||
|
// Initialize debug stacks
|
||||||
|
debug_stacks_init();
|
||||||
|
DSTACK(__FUNCTION_NAME);
|
||||||
|
|
||||||
// Debug handler
|
// Debug handler
|
||||||
BEGIN_DEBUG_EXCEPTION_HANDLER
|
BEGIN_DEBUG_EXCEPTION_HANDLER
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user