Make the log_domain constructor explicit
Implicitly constructing a log_domain from a string has the effect of resetting its severity to 1 (or whatever severity was passed to the constructor). This is probably fine when it's declared as a file static, but no good if passing the log_domain to a log_scope2() or dont_log() call.
This commit is contained in:
parent
3627cb5766
commit
d507833199
5 changed files with 7 additions and 7 deletions
|
@ -66,7 +66,7 @@ std::string deprecated_message(
|
|||
// Note: This message is duplicated in data/lua/core.lua
|
||||
// Any changes should be mirrorred there.
|
||||
std::string msg = VGETTEXT("Invalid deprecation level $level (should be 1-4)", err_params);
|
||||
LOG_STREAM(err, "general") << msg;
|
||||
LOG_STREAM(err, lg::general()) << msg;
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
@ -86,4 +86,4 @@ std::string deprecated_message(
|
|||
}
|
||||
|
||||
return message;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace game_events
|
|||
{
|
||||
void event_handlers::log_handlers()
|
||||
{
|
||||
if(lg::debug().dont_log("event_handler")) {
|
||||
if(lg::debug().dont_log(log_event_handler)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -533,7 +533,7 @@ pump_result_t wml_event_pump::operator()()
|
|||
return pump_result_t();
|
||||
}
|
||||
|
||||
if(!lg::debug().dont_log("event_handler")) {
|
||||
if(!lg::debug().dont_log(log_event_handler)) {
|
||||
std::stringstream ss;
|
||||
for(const queued_event& ev : impl_->events_queue) {
|
||||
ss << "name=" << ev.name << ", "
|
||||
|
|
|
@ -96,7 +96,7 @@ typedef std::pair<const std::string, int> logd;
|
|||
class log_domain {
|
||||
logd *domain_;
|
||||
public:
|
||||
log_domain(char const *name, int severity = 1);
|
||||
explicit log_domain(char const *name, int severity = 1);
|
||||
friend class logger;
|
||||
};
|
||||
|
||||
|
|
|
@ -1182,7 +1182,7 @@ void manager::set_planned_unit_map()
|
|||
return;
|
||||
}
|
||||
|
||||
log_scope2("whiteboard", "Building planned unit map");
|
||||
log_scope2(log_whiteboard, "Building planned unit map");
|
||||
mapbuilder_.reset(new mapbuilder(resources::gameboard->units()));
|
||||
mapbuilder_->build_map();
|
||||
|
||||
|
@ -1197,7 +1197,7 @@ void manager::set_real_unit_map()
|
|||
assert(!wait_for_side_init_);
|
||||
if(mapbuilder_)
|
||||
{
|
||||
log_scope2("whiteboard", "Restoring regular unit map.");
|
||||
log_scope2(log_whiteboard, "Restoring regular unit map.");
|
||||
mapbuilder_.reset();
|
||||
}
|
||||
planned_unit_map_active_ = false;
|
||||
|
|
Loading…
Add table
Reference in a new issue