Archive of the libbitcoin Slack #general channel.
72.65.246.83SYSCONFDIR not being defined in non-MSVC builds. This code was formerly operative but had become inadvertently excluded for some time. It seems that this may be something that we need to define in the build process. Otherwise I don't know why it would have always worked before but not now. LOG("Reject message '" << reject->message << "' ("
<< static_cast<uint16_t>(reject->code) << ") from [" << authority()
<< "] with reason: " << reject->reason); LOG("Received " << reject->message << " reject ("
<< static_cast<uint16_t>(reject->code) << ") from ["
<< authority() << "] '" << reject->reason << "'"
<< (reject->message == block::command ||
reject->message == transaction::command ? " [" +
encode_hash(reject->hash) + "]." : ""));class BCT_API logger
{
public:
class writer final
{
public:
DELETE_COPY_MOVE(writer);
inline writer(const logger& log) NOEXCEPT
: log_(log)
{
}
inline ~writer() NOEXCEPT
{
BC_PUSH_WARNING(NO_THROW_IN_NOEXCEPT)
log_.notify(error::success, stream_.str());
BC_POP_WARNING()
}
template <typename Type>
inline std::ostream& operator<<(const Type& message) NOEXCEPT
{
BC_PUSH_WARNING(NO_THROW_IN_NOEXCEPT)
stream_ << message;
BC_POP_WARNING()
return stream_;
}
private:
const logger& log_;
std::ostringstream stream_{};
};
typedef std::function<void(const code&, const std::string&)> handler;
logger() NOEXCEPT;
writer write() const NOEXCEPT;
void subscribe(handler&& handler) NOEXCEPT;
/// Stop the subscriber/pool with a final message posted to subscribers.
void stop(const std::string& message) NOEXCEPT;
void stop(const code& ec, const std::string& message) NOEXCEPT;
protected:
void notify(const code& ec, std::string&& message) const NOEXCEPT;
private:
threadpool pool_;
asio::strand strand_;
subscriber<const code&, const std::string&> subscriber_;
void do_subscribe(const handler& handler) NOEXCEPT;
void do_notify(const code& ec, const std::string& message) const NOEXCEPT;
void do_stop(const code& ec, const std::string& message) NOEXCEPT;
};logger_.write() << "Channel inactivity timeout [" << authority() << "]" << std::endl;(edited)
--initchain option to construct the database, and opens/closes the database on runs.std::ostream and writes to a log rotation sequence. As with the class impl, construct takes the file naming and size limit params. This allows console out and file out to be normalized to a std::ostream sink.