move a lot of spammy messages from info to debug domain

This commit is contained in:
Gunter Labes 2007-11-29 16:44:41 +00:00
parent edba6bc8cc
commit 8398b7c44a
6 changed files with 27 additions and 21 deletions

View file

@ -38,8 +38,9 @@
#include "serialization/binary_wml.hpp"
#include "serialization/parser.hpp"
#define DBG_NG LOG_STREAM(debug, engine)
#define LOG_NG LOG_STREAM(info, engine)
#define ERR_NW LOG_STREAM(err, network)
#define ERR_NG LOG_STREAM(err, engine)
struct castle_cost_calculator : cost_calculator
{
@ -186,7 +187,7 @@ std::string recruit_unit(const gamemap& map, int side,
if(ran_results != NULL) {
const std::string rc = (*ran_results)["checksum"];
if(rc != checksum) {
ERR_NW << "SYNC: In recruit " << new_unit.id() <<
ERR_NG << "SYNC: In recruit " << new_unit.id() <<
": has checksum " << checksum <<
" while datasource has checksum " <<
rc << "\n";
@ -210,15 +211,15 @@ std::string recruit_unit(const gamemap& map, int side,
// If an OOS happens, this option allows to write
// the debug info about the recruited unit.
if(!lg::info.dont_log(lg::engine)) {
if(!lg::debug.dont_log(lg::engine)) {
config cfg_unit;
new_unit.write(cfg_unit);
LOG_NG << "recruit unit\nChecksum = "
DBG_NG << "recruit unit\nChecksum = "
<< checksum << "\n-----[start data]-----\n";
::write(lg::info(lg::engine), cfg_unit);
LOG_NG << "\n----[end data]-----\n";
::write(lg::debug(lg::engine), cfg_unit);
DBG_NG << "\n----[end data]-----\n";
}
return std::string();

View file

@ -25,6 +25,7 @@ See the COPYING file for more details.
#include <iostream>
#define LOG_PF LOG_STREAM(info, engine)
#define DBG_PF LOG_STREAM(debug, engine)
typedef std::vector<gamemap::location> vector_location;
typedef std::vector<a_star_node*> vector_a_star_node;
@ -158,7 +159,7 @@ paths::route a_star_search(gamemap::location const &src, gamemap::location const
a_star_node *locDestNode = NULL;
a_star_node *locCurNode = NULL;
LOG_PF << "A* search: " << src << " -> " << dst << '\n';
DBG_PF << "A* search: " << src << " -> " << dst << '\n';
if (costCalculator->cost(src,dst, 0, true) >= stop_at) {
LOG_PF << "aborted A* search because Start or Dest is invalid\n";
@ -192,7 +193,7 @@ paths::route a_star_search(gamemap::location const &src, gamemap::location const
if(routeSolved) {
locDestNode = locCurNode;
LOG_PF << "found solution; calculating it...\n";
DBG_PF << "found solution; calculating it...\n";
while (locCurNode != NULL)
{
locRoute.steps.push_back(locCurNode->loc);
@ -204,7 +205,7 @@ paths::route a_star_search(gamemap::location const &src, gamemap::location const
wassert(locRoute.steps.front() == src);
wassert(locRoute.steps.back() == dst);
LOG_PF << "exiting a* search (solved)\n";
DBG_PF << "exiting a* search (solved)\n";
} else {
//route not solved
LOG_PF << "aborted a* search\n";

View file

@ -24,7 +24,8 @@
#include <cstdlib>
#include <sstream>
#define LOG_NG LOG_STREAM(info, engine)
#define DBG_NG LOG_STREAM(debug, engine)
#define ERR_NG LOG_STREAM(err, engine)
namespace game_config
@ -209,7 +210,7 @@ namespace game_config
if(tp.size()){
team_rgb_colors.insert(std::make_pair(id,tp));
//if this is being used, output log of palette for artists use.
LOG_NG << "color palette creation:\n";
DBG_NG << "color palette creation:\n";
std::stringstream str;
str << id <<" = ";
for(std::vector<Uint32>::const_iterator r=tp.begin();r!=tp.end();r++){
@ -221,7 +222,7 @@ namespace game_config
}
str << red << "," << green << "," << blue;
}
LOG_NG << str.str() <<"\n";
DBG_NG << str.str() <<"\n";
}
}
}

View file

@ -47,6 +47,7 @@
#include <set>
#include <string>
#define DBG_NG LOG_STREAM(debug, engine)
#define LOG_NG LOG_STREAM(info, engine)
#define WRN_NG LOG_STREAM(warn, engine)
#define ERR_NG LOG_STREAM(err, engine)
@ -1479,7 +1480,7 @@ bool event_handler::handle_event_command(const queued_event& event_info,
std::vector<unit>& avail = player->available_units;
for(std::vector<unit>::iterator u = avail.begin(); u != avail.end(); ++u) {
LOG_NG << "checking unit against filter...\n";
DBG_NG << "checking unit against filter...\n";
wassert(game_data_ptr != NULL);
u->set_game_context(game_data_ptr,units,game_map,status_ptr,teams);
scoped_recall_unit auto_store("this_unit", player_id, u - avail.begin());
@ -2261,7 +2262,7 @@ bool event_handler::handle_event_command(const queued_event& event_info,
label.colour());
}
LOG_NG << "done handling command...\n";
DBG_NG << "done handling command...\n";
return rval;
}

View file

@ -32,6 +32,7 @@
#define ERR_CF LOG_STREAM(err, config)
#define LOG_CF LOG_STREAM(info, config)
#define DBG_CF LOG_STREAM(debug, config)
using std::streambuf;
@ -378,7 +379,7 @@ std::string preprocessor_data::read_word()
for(;;) {
int c = in_->peek();
if (c == preprocessor_streambuf::traits_type::eof() || utils::portable_isspace(c)) {
// LOG_CF << "(" << res << ")\n";
// DBG_CF << "(" << res << ")\n";
return res;
}
in_->get();
@ -564,7 +565,7 @@ bool preprocessor_data::get_chunk()
skip_spaces();
std::string const &symbol = read_word();
bool skip = target_.defines_->count(symbol) == 0;
LOG_CF << "testing for macro " << symbol << ": " << (skip ? "not defined" : "defined") << '\n';
DBG_CF << "testing for macro " << symbol << ": " << (skip ? "not defined" : "defined") << '\n';
if (skip)
++skipping_;
push_token(skip ? 'J' : 'i');
@ -572,7 +573,7 @@ bool preprocessor_data::get_chunk()
skip_spaces();
std::string const &symbol = read_word();
bool skip = target_.defines_->count(symbol) != 0;
LOG_CF << "testing for macro " << symbol << ": " << (skip ? "not defined" : "defined") << '\n';
DBG_CF << "testing for macro " << symbol << ": " << (skip ? "not defined" : "defined") << '\n';
if (skip)
++skipping_;
push_token(skip ? 'J' : 'i');
@ -747,11 +748,11 @@ bool preprocessor_data::get_chunk()
pop_token();
std::string const &dir = directory_name(val.location.substr(0, val.location.find(' ')));
if (!slowpath_) {
LOG_CF << "substituting macro " << symbol << '\n';
DBG_CF << "substituting macro " << symbol << '\n';
new preprocessor_data(target_, buffer, val.location, "",
val.linenum, dir, val.textdomain);
} else {
LOG_CF << "substituting (slow) macro " << symbol << '\n';
DBG_CF << "substituting (slow) macro " << symbol << '\n';
std::ostringstream res;
preprocessor_streambuf *buf =
new preprocessor_streambuf(target_);

View file

@ -30,6 +30,7 @@
#include <cstdlib>
#include <sstream>
#define DBG_DP LOG_STREAM(debug, display)
#define LOG_DP LOG_STREAM(info, display)
namespace {
@ -598,7 +599,7 @@ void theme::add_object(const config& cfg){
const config::child_list& menu_list = cfg.get_children("menu");
for(config::child_list::const_iterator m = menu_list.begin(); m != menu_list.end(); ++m) {
menu new_menu(**m);
LOG_DP << "adding menu: " << (new_menu.is_context() ? "is context" : "not context") << "\n";
DBG_DP << "adding menu: " << (new_menu.is_context() ? "is context" : "not context") << "\n";
if(new_menu.is_context())
context_ = new_menu;
else{
@ -606,7 +607,7 @@ void theme::add_object(const config& cfg){
menus_.push_back(new_menu);
}
LOG_DP << "done adding menu...\n";
DBG_DP << "done adding menu...\n";
}
const config* const border_cfg = cfg.child("main_map_border");