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

Commit 02ea8f0

Browse files
gumb0chfast
authored andcommitted
Display --log-vmtrace option only for aleth.
Other modules that use logginOptions - aleth-vm has its own means of tracing and aleth-key don't need it. Correctly enable vmtrace in log setup in testeth.
1 parent 40d7fff commit 02ea8f0

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
- Changed: [#5532](https://github.com/ethereum/aleth/pull/5532) The leveldb is upgraded to 1.22. This is breaking change on Windows and the old databases are not compatible.
1515
- Changed: [#5559](https://github.com/ethereum/aleth/pull/5559) Update peer validation error messages.
1616
- Changed: [#5568](https://github.com/ethereum/aleth/pull/5568) Improve rlpx handshake log messages and create new rlpx log channel.
17-
- Changed: [#5570](https://github.com/ethereum/aleth/pull/5570) Now it's not necessary to recompile with VMTRACE flag to get VM trace log. Just use `testeth -- --vmtrace` or `aleth -v 4 --log-channels vmtrace`.
17+
- Changed: [#5570](https://github.com/ethereum/aleth/pull/5570) Now it's not necessary to recompile with VMTRACE flag to get VM trace log. Just use `testeth -- --vmtrace` or `aleth -v 4 --log-vmtrace`.
1818
- Changed: [#5576](https://github.com/ethereum/aleth/pull/5576) Moved sstore_combinations and static_Call50000_sha256 tests to stTimeConsuming test suite. (testeth runs them only with `--all` flag)
1919
- Changed: [#5589](https://github.com/ethereum/aleth/pull/5589) Make aleth output always line-buffered even when redirected to file or pipe.
2020
- Changed: [#5602](https://github.com/ethereum/aleth/pull/5602) Better predicting external IP address and UDP port.

aleth/main.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,11 @@ int main(int argc, char** argv)
327327
LoggingOptions loggingOptions;
328328
po::options_description loggingProgramOptions(
329329
createLoggingProgramOptions(c_lineWidth, loggingOptions, logChannels));
330+
// log-vmtrace is needed only in aleth
331+
auto addLoggingOption = loggingProgramOptions.add_options();
332+
addLoggingOption("log-vmtrace", po::bool_switch(&loggingOptions.vmTrace),
333+
"Enable VM trace log (requires log-verbosity 4).\n");
334+
330335

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

libdevcore/LoggingProgramOptions.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ po::options_description createLoggingProgramOptions(
4242
->value_name("<channel_list>")
4343
->multitoken(),
4444
"Space-separated list of the log channels to hide.\n");
45-
addLoggingOption("log-vmtrace", po::bool_switch(&_options.vmTrace),
46-
"Enable VM trace log (requires log-verbosity 4).\n");
4745

4846
return optionsDescr;
4947
}

test/tools/libtesteth/Options.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ void printVersion()
8383
}
8484
}
8585

86-
void Options::setVerbosity(int _level)
86+
void Options::setVerbosity(int _level, bool _vmTrace)
8787
{
8888
static boost::iostreams::stream<boost::iostreams::null_sink> nullOstream(
8989
(boost::iostreams::null_sink()));
@@ -98,6 +98,7 @@ void Options::setVerbosity(int _level)
9898
}
9999
else if (_level == 1 || _level == 2)
100100
logOptions.verbosity = VerbositySilent;
101+
logOptions.vmTrace = _vmTrace;
101102
dev::setupLogging(logOptions);
102103
}
103104

@@ -360,7 +361,7 @@ Options::Options(int argc, const char** argv)
360361
}
361362

362363
// If no verbosity is set. use default
363-
setVerbosity(verbosity == -1 ? 1 : verbosity);
364+
setVerbosity(verbosity == -1 ? 1 : verbosity, vmtrace);
364365
}
365366

366367
Options const& Options::get(int argc, const char** argv)

test/tools/libtesteth/Options.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class Options
7171
private:
7272
Options(int argc = 0, const char** argv = 0);
7373
Options(Options const&) = delete;
74-
void setVerbosity(int _level);
74+
void setVerbosity(int _level, bool _vmTrace);
7575
};
7676

7777
} //namespace test

0 commit comments

Comments
 (0)