Skip to content
This repository was archived by the owner on Oct 28, 2021. It is now read-only.

Commit 9b511f2

Browse files
authored
Merge pull request #5564 from twinstar26/master
Add log channels to Aleth command-line help output
2 parents aecf6c9 + b9a6f02 commit 9b511f2

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- Added: [#5537](https://github.com/ethereum/aleth/pull/5537) Creating Ethereum Node Record (ENR) at program start.
66
- Added: [#5557](https://github.com/ethereum/aleth/pull/5557) Improved debug logging of full sync.
7+
- Added: [#5564](https://github.com/ethereum/aleth/pull/5564) Improved help output of Aleth by adding list of channels.
78
- Changed: [#5559](https://github.com/ethereum/aleth/pull/5559) Update peer validation error messages.
89
- Fixed: [#5562](https://github.com/ethereum/aleth/pull/5562) Don't send header request messages to peers that haven't sent us Status yet.
910
- Changed: [#5568](https://github.com/ethereum/aleth/pull/5568) Improve rlpx handshake log messages and create new rlpx log channel.

aleth/main.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,9 +321,12 @@ int main(int argc, char** argv)
321321
addImportExportOption("import-snapshot", po::value<string>()->value_name("<path>"),
322322
"Import blockchain and state data from the Parity Warp Sync snapshot\n");
323323

324+
std::string const logChannels =
325+
"block blockhdr bq chain client debug discov error ethcap exec host impolite info net "
326+
"overlaydb peer rlpx rpc snap statedb sync timer tq trace vmtrace warn watch";
324327
LoggingOptions loggingOptions;
325328
po::options_description loggingProgramOptions(
326-
createLoggingProgramOptions(c_lineWidth, loggingOptions));
329+
createLoggingProgramOptions(c_lineWidth, loggingOptions, logChannels));
327330

328331
po::options_description generalOptions("GENERAL OPTIONS", c_lineWidth);
329332
auto addGeneralOption = generalOptions.add_options();

libdevcore/LoggingProgramOptions.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,22 @@ namespace po = boost::program_options;
2121

2222
namespace dev
2323
{
24-
po::options_description createLoggingProgramOptions(unsigned _lineLength, LoggingOptions& _options)
24+
po::options_description createLoggingProgramOptions(
25+
unsigned _lineLength, LoggingOptions& _options, std::string const& _logChannels)
2526
{
2627
po::options_description optionsDescr("LOGGING OPTIONS", _lineLength);
2728
auto addLoggingOption = optionsDescr.add_options();
2829
addLoggingOption("log-verbosity,v", po::value<int>(&_options.verbosity)->value_name("<0 - 4>"),
2930
"Set the log verbosity from 0 to 4 (default: 2).");
31+
32+
std::string const logChannelsDescription =
33+
"Space-separated list of the log channels to show (default: show all channels)." +
34+
(_logChannels.empty() ? "" : "\nChannels: " + _logChannels);
3035
addLoggingOption("log-channels",
3136
po::value<std::vector<std::string>>(&_options.includeChannels)
3237
->value_name("<channel_list>")
3338
->multitoken(),
34-
"Space-separated list of the log channels to show (default: show all channels).");
39+
logChannelsDescription.c_str());
3540
addLoggingOption("log-exclude-channels",
3641
po::value<std::vector<std::string>>(&_options.excludeChannels)
3742
->value_name("<channel_list>")

libdevcore/LoggingProgramOptions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@
2323
namespace dev
2424
{
2525
boost::program_options::options_description createLoggingProgramOptions(
26-
unsigned _lineLength, LoggingOptions& _options);
26+
unsigned _lineLength, LoggingOptions& _options, std::string const& _logChannels = {});
2727

2828
} // namespace dev

0 commit comments

Comments
 (0)