Commit 02f45c0b authored by Dominik Charousset's avatar Dominik Charousset

Adjust warnings, fix #132

This patch downgrades all warnings that could trigger in valid use cases (as
shown in #132) to infos.
parent b9388f29
......@@ -225,7 +225,7 @@ class local_group_proxy : public local_group {
}
return {who, this};
}
CPPA_LOG_WARNING("channel " << to_string(who) << " already joined");
CPPA_LOG_INFO("channel " << to_string(who) << " already joined");
return {};
}
......@@ -499,12 +499,9 @@ class remote_group_module : public abstract_group::module {
(*peers)[authority].second.push_back(make_pair(key, rg));
}
else {
cerr << "*** WARNING: received a non-local "
"group form nameserver for key "
<< key << " in file "
<< __FILE__
<< ", line " << __LINE__
<< endl;
CPPA_LOG_WARNING("received a non-local "
"group form nameserver for "
"key " << key);
sm->put(key, nullptr);
}
},
......
......@@ -185,8 +185,8 @@ class middleman_impl : public middleman {
return true;
}
else {
CPPA_LOG_WARNING("peer " << to_string(node) << " already defined, "
"multiple calls to remote_actor()?");
CPPA_LOG_INFO("peer " << to_string(node) << " already defined, "
"multiple calls to remote_actor()?");
return false;
}
}
......
......@@ -106,15 +106,13 @@ continue_reading_result peer::continue_reading() {
node_id::host_id_size);
m_node.reset(new node_id(process_id, host_id));
if (*parent()->node() == *m_node) {
std::cerr << "*** middleman warning: "
"incoming connection from self"
<< std::endl;
CPPA_LOG_INFO("incoming connection from self");
return continue_reading_result::failure;
}
CPPA_LOG_DEBUG("read process info: " << to_string(*m_node));
if (!parent()->register_peer(*m_node, this)) {
CPPA_LOG_ERROR("multiple incoming connections "
"from the same node");
CPPA_LOG_INFO("multiple incoming connections "
"from the same node");
return continue_reading_result::failure;
}
// initialization done
......@@ -365,9 +363,6 @@ void peer::enqueue_impl(msg_hdr_cref hdr, const any_tuple& msg) {
try { bs << hdr << msg; }
catch (exception& e) {
CPPA_LOG_ERROR(to_verbose_string(e));
cerr << "*** exception in peer::enqueue; "
<< to_verbose_string(e)
<< endl;
return;
}
CPPA_LOG_DEBUG("serialized: " << to_string(hdr) << " " << to_string(msg));
......
......@@ -47,7 +47,7 @@ continue_reading_result peer_acceptor::continue_reading() {
optional<stream_ptr_pair> opt{none};
try { opt = m_ptr->try_accept_connection(); }
catch (exception& e) {
CPPA_LOG_ERROR(to_verbose_string(e));
CPPA_LOG_WARNING("accept failed: " << to_verbose_string(e));
static_cast<void>(e); // keep compiler happy
return continue_reading_result::failure;
}
......@@ -73,10 +73,10 @@ continue_reading_result peer_acceptor::continue_reading() {
m_parent->new_peer(pair.first, pair.second);
}
catch (exception& e) {
CPPA_LOG_ERROR(to_verbose_string(e));
cerr << "*** exception while sending actor and process id; "
<< to_verbose_string(e)
<< endl;
CPPA_LOG_WARNING("exception while sending actor "
"and process id: " << to_verbose_string(e));
static_cast<void>(e);
return continue_reading_result::failure;
}
}
else return continue_reading_result::continue_later;
......
......@@ -126,11 +126,8 @@ class timer_actor final : public detail::proper_actor<blocking_actor,
done = true;
},
others() >> [&]() {
# ifdef CPPA_DEBUG_MODE
std::cerr << "coordinator::timer_loop: UNKNOWN MESSAGE: "
<< to_string(msg_ptr->msg)
<< std::endl;
# endif
CPPA_LOG_WARNING("coordinator::timer_loop: UNKNOWN MESSAGE: "
<< to_string(msg_ptr->msg));
}
);
// loop
......@@ -206,10 +203,9 @@ void printer_loop(blocking_actor* self) {
on(atom("DIE")) >> [&] {
running = false;
},
others() >> [self] {
std::cerr << "*** unexpected: "
<< to_string(self->last_dequeued())
<< std::endl;
others() >> [&] {
CPPA_LOGF_WARNING("unexpected message: "
<< to_string(self->last_dequeued()));
}
);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment