[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth/src game.cpp
From: |
Guillaume Melquiond |
Subject: |
[Wesnoth-cvs-commits] wesnoth/src game.cpp |
Date: |
Sat, 18 Sep 2004 19:07:59 -0400 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: Guillaume Melquiond <address@hidden> 04/09/18 22:56:00
Modified files:
src : game.cpp
Log message:
Put back the --log option
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/game.cpp.diff?tr1=1.131&tr2=1.132&r1=text&r2=text
Patches:
Index: wesnoth/src/game.cpp
diff -u wesnoth/src/game.cpp:1.131 wesnoth/src/game.cpp:1.132
--- wesnoth/src/game.cpp:1.131 Sat Sep 18 21:42:13 2004
+++ wesnoth/src/game.cpp Sat Sep 18 22:56:00 2004
@@ -1,4 +1,4 @@
-/* $Id: game.cpp,v 1.131 2004/09/18 21:42:13 Sirp Exp $ */
+/* $Id: game.cpp,v 1.132 2004/09/18 22:56:00 silene Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -1203,6 +1203,9 @@
<< " -t, --test Runs the game in a small
example scenario\n"
<< " -w, --windowed Runs the game in windowed
mode\n"
<< " -v, --version Prints the game's version
number and exits\n"
+ << " --log-error=\"domain1,domain2,...\",
--log-warning=..., --log-info=...\n"
+ << " Set the severity level of the
debug domains\n"
+ << " \"all\" can be used to match
any debug domain\n"
<< " --nocache Disables caching of game
data\n";
return 0;
} else if(val == "--version" || val == "-v") {
@@ -1215,6 +1218,30 @@
return 0;
} else if(val == "--nosound") {
use_sound = false;
+ } else if (val.substr(0, 6) == "--log-") {
+ size_t p = val.find('=');
+ if (p == std::string::npos) {
+ std::cerr << "unknown option: " << val << '\n';
+ return 0;
+ }
+ std::string s = val.substr(6, p - 6);
+ int severity;
+ if (s == "error") severity = 0;
+ else if (s == "warning") severity = 1;
+ else if (s == "info") severity = 2;
+ else {
+ std::cerr << "unknown debug level: " << s <<
'\n';
+ return 0;
+ }
+ while (p != std::string::npos) {
+ size_t q = val.find(',', p + 1);
+ s = val.substr(p + 1, q == std::string::npos ?
q : q - (p + 1));
+ if (!lg::set_log_domain_severity(s, severity)) {
+ std::cerr << "unknown debug domain: "
<< s << '\n';
+ return 0;
+ }
+ p = q;
+ }
} else if(val == "--publish-campaign") {
if(arg+3 != argc && arg+4 != argc && arg+5 != argc) {
std::cerr << "usage: --publish-campaign
<campaign> <passphrase> [<server> [<port>]]\n";
- [Wesnoth-cvs-commits] wesnoth/src game.cpp, Yann Dirson, 2004/09/02
- [Wesnoth-cvs-commits] wesnoth/src game.cpp, David White, 2004/09/08
- [Wesnoth-cvs-commits] wesnoth/src game.cpp, David White, 2004/09/12
- [Wesnoth-cvs-commits] wesnoth/src game.cpp, David White, 2004/09/12
- [Wesnoth-cvs-commits] wesnoth/src game.cpp, Guillaume Melquiond, 2004/09/18
- [Wesnoth-cvs-commits] wesnoth/src game.cpp,
Guillaume Melquiond <=
- [Wesnoth-cvs-commits] wesnoth/src game.cpp, Philippe Plantier, 2004/09/18
- [Wesnoth-cvs-commits] wesnoth/src game.cpp, David White, 2004/09/18
- [Wesnoth-cvs-commits] wesnoth/src game.cpp, Guillaume Melquiond, 2004/09/19
- [Wesnoth-cvs-commits] wesnoth/src game.cpp, Yann Dirson, 2004/09/19