mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-01 16:35:53 +00:00
Improve log level selection from command line. Some extra shutdown logging.
This commit is contained in:
@@ -57,6 +57,7 @@ extern int RpcDBCount, TxnDBCount, LedgerDBCount, WalletDBCount, HashNodeDBCount
|
||||
|
||||
void Application::stop()
|
||||
{
|
||||
cLog(lsINFO) << "Received shutdown request";
|
||||
mIOService.stop();
|
||||
mJobQueue.shutdown();
|
||||
mHashedObjectStore.bulkWrite();
|
||||
|
||||
@@ -181,6 +181,7 @@ void JobQueue::shutdown()
|
||||
mJobCond.notify_all();
|
||||
while (mThreadCount != 0)
|
||||
mJobCond.wait(sl);
|
||||
cLog(lsDEBUG) << "Job queue has shut down";
|
||||
}
|
||||
|
||||
void JobQueue::setThreadCount(int c)
|
||||
|
||||
@@ -260,6 +260,7 @@ void ValidationCollection::flush()
|
||||
{
|
||||
bool anyNew = false;
|
||||
|
||||
cLog(lsINFO) << "Flushing validations";
|
||||
boost::mutex::scoped_lock sl(mValidationLock);
|
||||
BOOST_FOREACH(u160_val_pair& it, mCurrentValidations)
|
||||
{
|
||||
@@ -276,6 +277,7 @@ void ValidationCollection::flush()
|
||||
boost::this_thread::sleep(boost::posix_time::milliseconds(100));
|
||||
sl.lock();
|
||||
}
|
||||
cLog(lsDEBUG) << "Validations flushed";
|
||||
}
|
||||
|
||||
void ValidationCollection::condWrite()
|
||||
|
||||
@@ -90,7 +90,7 @@ int main(int argc, char* argv[])
|
||||
//
|
||||
// Set up option parsing.
|
||||
//
|
||||
po::options_description desc("Options");
|
||||
po::options_description desc("General Options");
|
||||
desc.add_options()
|
||||
("help,h", "Display this message.")
|
||||
("conf", po::value<std::string>(), "Specify the configuration file.")
|
||||
@@ -99,12 +99,21 @@ int main(int argc, char* argv[])
|
||||
("test,t", "Perform unit tests.")
|
||||
("parameters", po::value< vector<string> >(), "Specify comma separated parameters.")
|
||||
("quiet,q", "Reduce diagnotics.")
|
||||
("verbose,v", "Increase log level.")
|
||||
("verbose,v", "Verbose logging.")
|
||||
("load", "Load the current ledger from the local DB.")
|
||||
("start", "Start from a fresh Ledger.")
|
||||
("net", "Get the initial ledger from the network.")
|
||||
;
|
||||
|
||||
po::options_description hidden("Hidden Options");
|
||||
hidden.add_options()
|
||||
("trace,vvv", "Trace level logging")
|
||||
("debug,vv", "Debug level logging")
|
||||
;
|
||||
|
||||
po::options_description all("All Options");
|
||||
all.add(desc).add(hidden);
|
||||
|
||||
// Interpret positional arguments as --parameters.
|
||||
po::positional_options_description p;
|
||||
p.add("parameters", -1);
|
||||
@@ -129,7 +138,7 @@ int main(int argc, char* argv[])
|
||||
// Parse options, if no error.
|
||||
try {
|
||||
po::store(po::command_line_parser(argc, argv)
|
||||
.options(desc) // Parse options.
|
||||
.options(all) // Parse options.
|
||||
.positional(p) // Remainder as --parameters.
|
||||
.run(),
|
||||
vm);
|
||||
@@ -141,10 +150,15 @@ int main(int argc, char* argv[])
|
||||
}
|
||||
}
|
||||
|
||||
if (vm.count("verbose"))
|
||||
if (vm.count("trace"))
|
||||
Log::setMinSeverity(lsTRACE, true);
|
||||
else if (vm.count("debug"))
|
||||
Log::setMinSeverity(lsDEBUG, true);
|
||||
else if (vm.count("verbose"))
|
||||
Log::setMinSeverity(lsINFO, true);
|
||||
else
|
||||
Log::setMinSeverity(lsWARNING, true);
|
||||
|
||||
InstanceType::multiThread();
|
||||
|
||||
if (vm.count("test"))
|
||||
|
||||
Reference in New Issue
Block a user