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