summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-03-11 15:28:35 +0200
committerPerttu Ahola <celeron55@gmail.com>2012-03-11 15:28:35 +0200
commit3da05a09b5cf5160a897e8c65b9ce60f19157946 (patch)
tree5d187365ad822591db25c38a1941f3df756b58bf /src/main.cpp
parentf79082a46d5b2385ae5aebf9048d4ca8b87940c3 (diff)
downloadminetest-3da05a09b5cf5160a897e8c65b9ce60f19157946.tar.gz
minetest-3da05a09b5cf5160a897e8c65b9ce60f19157946.tar.bz2
minetest-3da05a09b5cf5160a897e8c65b9ce60f19157946.zip
--logfile '' = no logging
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 1b4047de7..b85dee77c 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 = "<<logfile<<std::endl;
infostream<<"path_share = "<<porting::path_share<<std::endl;
infostream<<"path_user = "<<porting::path_user<<std::endl;
+ // Initialize debug stacks
+ debug_stacks_init();
+ DSTACK(__FUNCTION_NAME);
+
// Debug handler
BEGIN_DEBUG_EXCEPTION_HANDLER