Commit 23ee3aad authored by Ivan Vilata-i-Balaguer's avatar Ivan Vilata-i-Balaguer
Browse files

Use logger in assorted minor modules.

parent 1208a414
......@@ -4,6 +4,7 @@
#include <iostream>
#include <boost/asio/buffer.hpp>
#include <boost/utility/string_view.hpp>
#include "../logger.h"
#include "../namespaces.h"
#include "../or_throw.h"
#include "../util/condition_variable.h"
......@@ -90,7 +91,7 @@ UdpMultiplexer::UdpMultiplexer(asio_utp::udp_multiplexer&& s):
{
assert(_socket.is_open());
std::cerr << "BT is operating on endpoint: UDP:" << _socket.local_endpoint() << "\n";
LOG_INFO("BT is operating on endpoint: UDP:", _socket.local_endpoint());
#if 0
asio::spawn(get_executor(), [this] (asio::yield_context yield) {
......
......@@ -2,6 +2,8 @@
#include <sys/resource.h>
#include "logger.h"
namespace ouinet {
// Temporary, until this is merged https://github.com/ipfs/go-ipfs/pull/4288
......@@ -16,14 +18,14 @@ void increase_open_file_limit(rlim_t new_value)
int r = getrlimit(RLIMIT_NOFILE, &rl);
if (r != 0) {
cerr << "Failed to get the current RLIMIT_NOFILE value" << endl;
LOG_ERROR("Failed to get the current RLIMIT_NOFILE value");
return;
}
cout << "Default RLIMIT_NOFILE value is: " << rl.rlim_cur << endl;
LOG_DEBUG("Default RLIMIT_NOFILE value is: ", rl.rlim_cur);
if (rl.rlim_cur >= new_value) {
cout << "Leaving RLIMIT_NOFILE value unchanged." << endl;
LOG_DEBUG("Leaving RLIMIT_NOFILE value unchanged.");
return;
}
......@@ -32,13 +34,13 @@ void increase_open_file_limit(rlim_t new_value)
r = setrlimit(RLIMIT_NOFILE, &rl);
if (r != 0) {
cerr << "Failed to set the RLIMIT_NOFILE value to " << rl.rlim_cur << endl;
LOG_ERROR("Failed to set the RLIMIT_NOFILE value to ", rl.rlim_cur);
return;
}
r = getrlimit(RLIMIT_NOFILE, &rl);
assert(r == 0);
cout << "RLIMIT_NOFILE value changed to: " << rl.rlim_cur << endl;
LOG_DEBUG("RLIMIT_NOFILE value changed to: ", rl.rlim_cur);
}
} // ouinet namespace
......@@ -8,11 +8,10 @@
#include <experimental/tuple>
#include "liblampshade.h"
#include "../../logger.h"
#include "../../or_throw.h"
#include "../../util/str.h"
#include <iostream>
namespace ouinet {
namespace lampshade {
......@@ -518,7 +517,7 @@ void generate_key_pair_callback(
) {
Keypair* buffer = reinterpret_cast<Keypair*>(arg);
if (error) {
std::cerr << "error: " << error << "\n";
LOG_ERROR("Lampshade: ", error);
buffer->ec = boost::system::errc::make_error_code(boost::system::errc::no_message);
} else {
buffer->ec = sys::error_code();
......
Supports Markdown
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