Skip to content

Commit

Permalink
Using argv path instead of working directory for log directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
clemahieu committed Dec 12, 2014
1 parent 335f67b commit 7b87f28
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion rai/cli/daemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ void rai_daemon::daemon::run ()
auto pool (boost::make_shared <boost::network::utils::thread_pool> ());
rai::processor_service processor;
rai::client_init init;
auto client (std::make_shared <rai::client> (init, service, config.peering_port, working / "data", processor, config.representative));
auto client (std::make_shared <rai::client> (init, service, config.peering_port, working, processor, config.representative));
if (!init.error ())
{
client->bootstrap_peers = config.bootstrap_peers;
Expand Down
8 changes: 4 additions & 4 deletions rai/core/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -828,12 +828,12 @@ bool rai::client_init::error ()
return !block_store_init.ok () || wallet_init || ledger_init;
}

rai::client::client (rai::client_init & init_a, boost::shared_ptr <boost::asio::io_service> service_a, uint16_t port_a, boost::filesystem::path const & data_path_a, rai::processor_service & processor_a, rai::account const & representative_a) :
rai::client::client (rai::client_init & init_a, boost::shared_ptr <boost::asio::io_service> service_a, uint16_t port_a, boost::filesystem::path const & application_path_a, rai::processor_service & processor_a, rai::account const & representative_a) :
representative (representative_a),
store (init_a.block_store_init, data_path_a),
store (init_a.block_store_init, application_path_a / "data"),
ledger (init_a.ledger_init, init_a.block_store_init, store),
conflicts (*this),
wallet (init_a.wallet_init, data_path_a),
wallet (init_a.wallet_init, application_path_a / "wallet"),
network (*service_a, port_a, *this),
bootstrap (*service_a, port_a, *this),
processor (*this),
Expand All @@ -845,7 +845,7 @@ service (processor_a)
{
boost::log::add_console_log (std::cerr);
}
boost::log::add_file_log (boost::log::keywords::target = boost::filesystem::current_path () / "log", boost::log::keywords::file_name = boost::filesystem::current_path () / "log" / "log_%Y-%m-%d_%H-%M-%S.%N.log", boost::log::keywords::rotation_size = 4 * 1024 * 1024, boost::log::keywords::auto_flush = rai::rai_network != rai::rai_networks::rai_test_network, boost::log::keywords::scan_method = boost::log::sinks::file::scan_method::scan_matching, boost::log::keywords::max_size = 16 * 1024 * 1024);
boost::log::add_file_log (boost::log::keywords::target = application_path_a / "log", boost::log::keywords::file_name = application_path_a / "log" / "log_%Y-%m-%d_%H-%M-%S.%N.log", boost::log::keywords::rotation_size = 4 * 1024 * 1024, boost::log::keywords::auto_flush = rai::rai_network != rai::rai_networks::rai_test_network, boost::log::keywords::scan_method = boost::log::sinks::file::scan_method::scan_matching, boost::log::keywords::max_size = 16 * 1024 * 1024);
BOOST_LOG (log) << "Client starting";
ledger.send_observer = [this] (rai::send_block const & block_a, rai::account const & account_a, rai::amount const & balance_a)
{
Expand Down
2 changes: 1 addition & 1 deletion rai/qt_client/entry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ int main (int argc, char ** argv)
auto service (boost::make_shared <boost::asio::io_service> ());
rai::processor_service processor;
rai::client_init init;
auto client (std::make_shared <rai::client> (init, service, config.peering_port, boost::filesystem::system_complete (argv[0]).parent_path () / "data", processor, config.representative));
auto client (std::make_shared <rai::client> (init, service, config.peering_port, boost::filesystem::system_complete (argv[0]).parent_path (), processor, config.representative));
QObject::connect (&application, &QApplication::aboutToQuit, [&] ()
{
client->stop ();
Expand Down

0 comments on commit 7b87f28

Please sign in to comment.