From: Perttu Ahola Date: Sun, 11 Mar 2012 13:28:35 +0000 (+0200) Subject: --logfile '' = no logging X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=3da05a09b5cf5160a897e8c65b9ce60f19157946;p=zefram%2Fminetest%2Fminetest_engine.git --logfile '' = no logging --- diff --git a/src/main.cpp b/src/main.cpp index 1b4047de..b85dee77 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -781,7 +781,7 @@ int main(int argc, char *argv[]) allowed_options.insert("verbose", ValueSpec(VALUETYPE_FLAG, "Print more information to console")); allowed_options.insert("logfile", ValueSpec(VALUETYPE_STRING, - "Set logfile path (debug.txt)")); + "Set logfile path ('' = no logging)")); allowed_options.insert("gameid", ValueSpec(VALUETYPE_STRING, "Set gameid (\"--gameid list\" prints available ones)")); #ifndef SERVER @@ -854,17 +854,19 @@ int main(int argc, char *argv[]) #endif if(cmd_args.exists("logfile")) logfile = cmd_args.get("logfile"); - bool disable_stderr = false; - debugstreams_init(disable_stderr, logfile.c_str()); - // Initialize debug stacks - debug_stacks_init(); - - DSTACK(__FUNCTION_NAME); + if(logfile != "") + debugstreams_init(false, logfile.c_str()); + else + debugstreams_init(false, NULL); infostream<<"logfile = "<