[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth/src unit.cpp unit_types.cpp
From: |
Guillaume Melquiond |
Subject: |
[Wesnoth-cvs-commits] wesnoth/src unit.cpp unit_types.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:49
Modified files:
src : unit.cpp unit_types.cpp
Log message:
Switched to the new logging system
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/unit.cpp.diff?tr1=1.96&tr2=1.97&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/unit_types.cpp.diff?tr1=1.65&tr2=1.66&r1=text&r2=text
Patches:
Index: wesnoth/src/unit.cpp
diff -u wesnoth/src/unit.cpp:1.96 wesnoth/src/unit.cpp:1.97
--- wesnoth/src/unit.cpp:1.96 Sat Sep 18 10:06:57 2004
+++ wesnoth/src/unit.cpp Sat Sep 18 22:56:49 2004
@@ -1,4 +1,4 @@
-/* $Id: unit.cpp,v 1.96 2004/09/18 10:06:57 silene Exp $ */
+/* $Id: unit.cpp,v 1.97 2004/09/18 22:56:49 silene Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -26,6 +26,12 @@
#include <iostream>
#include <sstream>
+namespace lg {
+log_domain engine("engine");
+}
+
+#define LOG_UT lg::info(lg::engine)
+
namespace {
const std::string ModificationTypes[] = { "object", "trait", "advance"
};
const size_t NumModificationTypes = sizeof(ModificationTypes)/
@@ -1015,7 +1021,7 @@
}
}
} else if(apply_to == "hitpoints") {
- std::cerr << "applying hitpoint mod...." << hitpoints_
<< "/" << maxHitpoints_ << "\n";
+ LOG_UT << "applying hitpoint mod...." << hitpoints_ <<
"/" << maxHitpoints_ << "\n";
const std::string& increase_hp =
(**i.first)["increase"];
const std::string& heal_full = (**i.first)["heal_full"];
const std::string& increase_total =
(**i.first)["increase_total"];
@@ -1047,9 +1053,9 @@
hitpoints_ += increase;
}
- std::cerr << "modded to " << hitpoints_ << "/" <<
maxHitpoints_ << "\n";
+ LOG_UT << "modded to " << hitpoints_ << "/" <<
maxHitpoints_ << "\n";
if(hitpoints_ > maxHitpoints_ && violate_max.empty()) {
- std::cerr << "resetting hp to max\n";
+ LOG_UT << "resetting hp to max\n";
hitpoints_ = maxHitpoints_;
}
Index: wesnoth/src/unit_types.cpp
diff -u wesnoth/src/unit_types.cpp:1.65 wesnoth/src/unit_types.cpp:1.66
--- wesnoth/src/unit_types.cpp:1.65 Sat Sep 18 21:42:13 2004
+++ wesnoth/src/unit_types.cpp Sat Sep 18 22:56:49 2004
@@ -1,4 +1,4 @@
-/* $Id: unit_types.cpp,v 1.65 2004/09/18 21:42:13 Sirp Exp $ */
+/* $Id: unit_types.cpp,v 1.66 2004/09/18 22:56:49 silene Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -13,6 +13,7 @@
#include "game_config.hpp"
#include "gamestatus.hpp"
#include "language.hpp"
+#include "log.hpp"
#include "unit_types.hpp"
#include "util.hpp"
@@ -370,7 +371,7 @@
if(movement_costs != NULL) {
const std::vector<std::string> names =
map.underlying_terrain_name(terrain);
if(names.size() != 1) {
- std::cerr << "terrain '" << terrain << "' has " <<
names.size() << " underlying names - 0 expected\n";
+ lg::err(lg::config) << "terrain '" << terrain << "' has
" << names.size() << " underlying names - 0 expected\n";
return impassable;
}
@@ -430,7 +431,7 @@
if(defense != NULL) {
const std::vector<std::string> names =
map.underlying_terrain_name(terrain);
if(names.size() != 1) {
- std::cerr << "terrain '" << terrain << "' has " <<
names.size() << " underlying names - 0 expected\n";
+ lg::err(lg::config) << "terrain '" << terrain << "' has
" << names.size() << " underlying names - 0 expected\n";
return 100;
}
@@ -875,8 +876,7 @@
else if(align == "neutral")
return NEUTRAL;
else {
- std::cerr << "Invalid alignment found for " << name()
- << ": '" << align << "'\n";
+ lg::err(lg::config) << "Invalid alignment found for " << name()
<< ": '" << align << "'\n";
return NEUTRAL;
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Wesnoth-cvs-commits] wesnoth/src unit.cpp unit_types.cpp,
Guillaume Melquiond <=