Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/wesnoth/wesnoth
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeck88 committed Jun 30, 2014
2 parents 74fac0b + bae75f5 commit d3fb787
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion scons/pango.py
Expand Up @@ -18,7 +18,7 @@ def CheckPango(context, backend, require_version = None):
env["ENV"]["PKG_CONFIG_PATH"] = environ.get("PKG_CONFIG_PATH")
version_arg = ""
if require_version:
version_arg = " \\>= " + require_version
version_arg = env["ESCAPE"](" >= ") + require_version
env.ParseConfig("pkg-config --libs --cflags $PKGCONFIG_FLAGS pango" + backend + version_arg)
context.Result("yes")
return True
Expand Down
24 changes: 14 additions & 10 deletions src/campaign_server/campaign_server.cpp
Expand Up @@ -48,8 +48,11 @@
#include <errno.h>
#endif

static lg::log_domain log_network("network");
#define LOG_CS if(lg::err.dont_log(log_network)) ; else lg::err(log_network, false)
static lg::log_domain log_campaignd("campaignd");
#define DBG_CS LOG_STREAM(debug, log_campaignd)
#define LOG_CS LOG_STREAM(info, log_campaignd)
#define WRN_CS LOG_STREAM(warn, log_campaignd)
#define ERR_CS LOG_STREAM(err, log_campaignd)

//compatibility code for MS compilers
#ifndef SIGHUP
Expand Down Expand Up @@ -177,7 +180,7 @@ void server::load_blacklist()
blacklist_.read(blcfg);
LOG_CS << "using blacklist from " << blacklist_file_ << '\n';
} catch(const config::error&) {
LOG_CS << "ERROR: failed to read blacklist from " << blacklist_file_ << ", blacklist disabled\n";
ERR_CS << "failed to read blacklist from " << blacklist_file_ << ", blacklist disabled\n";
}
}

Expand All @@ -200,13 +203,13 @@ void server::fire(const std::string& hook, const std::string& addon)
}

#if defined(_WIN32)
LOG_CS << "ERROR: Tried to execute a script on an unsupported platform" << std::endl;
ERR_CS << "Tried to execute a script on an unsupported platform\n";
return;
#else
pid_t childpid;

if((childpid = fork()) == -1) {
LOG_CS << "ERROR: fork failed while updating campaign " << addon << std::endl;
ERR_CS << "fork failed while updating campaign " << addon << '\n';
return;
}

Expand Down Expand Up @@ -238,7 +241,7 @@ void server::send_error(const std::string& msg, network::connection sock)
{
config cfg;
cfg.add_child("error")["message"] = msg;
LOG_CS << "ERROR [" << network::ip_address(sock) << "]: " << msg << '\n';
ERR_CS << "[" << network::ip_address(sock) << "]: " << msg << '\n';
network::send_data(cfg, sock);
}

Expand Down Expand Up @@ -298,7 +301,7 @@ void server::run()
}
} catch(network::error& e) {
if(!e.socket) {
LOG_CS << "fatal network error: " << e.message << "\n";
ERR_CS << "fatal network error: " << e.message << "\n";
throw;
} else {
LOG_CS << "client disconnect: " << e.message << " " << network::ip_address(e.socket) << "\n";
Expand All @@ -317,7 +320,7 @@ void server::run()
}

if(err_sock) {
LOG_CS << "client disconnect due to exception: " << e.what() << " " << network::ip_address(err_sock) << "\n";
ERR_CS << "client disconnect due to exception: " << e.what() << " " << network::ip_address(err_sock) << "\n";
network::disconnect(err_sock);
} else {
throw;
Expand Down Expand Up @@ -445,7 +448,7 @@ void server::handle_request_campaign(const server::request& req)

if(size < 0) {
std::cerr << " size: <unknown> KiB\n";
LOG_CS << "File size unknown, aborting send.\n";
ERR_CS << "File size unknown, aborting send.\n";
send_error("Add-on '" + req.cfg["name"].str() + "' could not be read by the server.", req.sock);
return;
}
Expand Down Expand Up @@ -655,7 +658,7 @@ void server::handle_delete(const server::request& req)
// Erase the campaign.
write_file(campaign["filename"], std::string());
if(remove(campaign["filename"].str().c_str()) != 0) {
LOG_CS << "failed to delete archive for campaign '" << erase["name"]
ERR_CS << "failed to delete archive for campaign '" << erase["name"]
<< "' (" << campaign["filename"] << "): " << strerror(errno)
<< '\n';
}
Expand Down Expand Up @@ -710,6 +713,7 @@ int main(int argc, char**argv)
{
game_config::path = get_cwd();

lg::set_log_domain_severity("campaignd", lg::info);
lg::timestamps(true);

try {
Expand Down

0 comments on commit d3fb787

Please sign in to comment.