diff options
author | Riccardo Spagni <ric@spagni.net> | 2015-05-30 22:29:57 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2015-05-30 22:29:59 +0200 |
commit | b9371749968611ba5dabe85c10cc34a139710685 (patch) | |
tree | 1788c0b127708df6c78beebdd2b5e4029ef7372f /src/daemon | |
parent | explicitly include libc++ with clang (diff) | |
parent | daemon: Set log file default to use data dir (diff) | |
download | monero-b9371749968611ba5dabe85c10cc34a139710685.tar.xz |
Merge pull request #293
10ff75e daemon: Set log file default to use data dir (warptangent)
deacecc simplewallet: Update and add log options (warptangent)
f24bcd5 simplewallet: Don't log view key and spend key (warptangent)
Diffstat (limited to 'src/daemon')
-rw-r--r-- | src/daemon/main.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/daemon/main.cpp b/src/daemon/main.cpp index 62b655ccd..b8f0b697b 100644 --- a/src/daemon/main.cpp +++ b/src/daemon/main.cpp @@ -155,6 +155,12 @@ int main(int argc, char const * argv[]) auto data_dir_arg = testnet_mode ? command_line::arg_testnet_data_dir : command_line::arg_data_dir; + // data_dir + // default: e.g. ~/.bitmonero/ or ~/.bitmonero/testnet + // if data-dir argument given: + // absolute path + // relative path: relative to cwd + // Create data dir if it doesn't exist boost::filesystem::path data_dir = boost::filesystem::absolute( command_line::get_arg(vm, data_dir_arg)); @@ -238,9 +244,18 @@ int main(int argc, char const * argv[]) } } + // log_file_path + // default: <data_dir>/<CRYPTONOTE_NAME>.log + // if log-file argument given: + // absolute path + // relative path: relative to data_dir + // Set log file { - bf::path log_file_path{bf::absolute(command_line::get_arg(vm, daemon_args::arg_log_file), relative_path_base)}; + bf::path log_file_path {data_dir / std::string(CRYPTONOTE_NAME ".log")}; + if (! vm["log-file"].defaulted()) + log_file_path = command_line::get_arg(vm, daemon_args::arg_log_file); + log_file_path = bf::absolute(log_file_path, relative_path_base); epee::log_space::log_singletone::add_logger( LOGGER_FILE |