diff options
| author | Riccardo Spagni <ric@spagni.net> | 2017-01-15 20:31:16 -0500 |
|---|---|---|
| committer | Riccardo Spagni <ric@spagni.net> | 2017-01-15 20:31:16 -0500 |
| commit | ac7df193ca47261c2dfd91b230489e20955013a2 (patch) | |
| tree | e4d312059948a0528583e7ea58d2c0b40307a494 /contrib/otshell_utils/runoptions.cpp | |
| parent | e459d8604df600d3094fba269ecbcf22867cf171 (diff) | |
| parent | 5833d66f6540e7b34e10ddef37c2b67bd501994b (diff) | |
| download | monzero-core-ac7df193ca47261c2dfd91b230489e20955013a2.tar.gz monzero-core-ac7df193ca47261c2dfd91b230489e20955013a2.tar.xz monzero-core-ac7df193ca47261c2dfd91b230489e20955013a2.zip | |
Merge pull request #1522
5833d66f Change logging to easylogging++ (moneromooo-monero)
dc98019b easylogging++: fix logging with static const header only data members (moneromooo-monero)
3b46617b easylogging++: add ELPP_DISABLE_CHECK_MACROS (moneromooo-monero)
6fe39d90 easylogging++: allow clipping a common filename prefix (moneromooo-monero)
43abf6ff easylogging++: add file-only logs (moneromooo-monero)
c313bea4 eayslogging++: Fix bad memory access before opening any files (moneromooo-monero)
0af5d168 easylogging++: avoid creating directory/filename for the builtin default log file (moneromooo-monero)
28362847 easylogging++: allow setting thread names (moneromooo-monero)
ec71ce8d easylogging++: Print thread ID in a nicer way (moneromooo-monero)
2a0bf783 easylogging++: Add logging categories (moneromooo-monero)
c50bbbfe easylogging++: import upstream (moneromooo-monero)
Diffstat (limited to 'contrib/otshell_utils/runoptions.cpp')
| -rw-r--r-- | contrib/otshell_utils/runoptions.cpp | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/contrib/otshell_utils/runoptions.cpp b/contrib/otshell_utils/runoptions.cpp deleted file mode 100644 index ffd37eae4..000000000 --- a/contrib/otshell_utils/runoptions.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/* See other files here for the LICENCE that applies here. */ -/* See header file .hpp for info */ - -#include "runoptions.hpp" - -#include "lib_common1.hpp" - -namespace nOT { - -INJECT_OT_COMMON_USING_NAMESPACE_COMMON_1 // <=== namespaces - -// (no debug - this is the default) -// +nodebug (no debug) -// +debug ...... --asdf -// +debug +debugcerr .... --asfs -// +debug +debugfile .... --asfs - -cRunOptions::cRunOptions() - : mRunMode(eRunModeCurrent), mDebug(false), mDebugSendToFile(false), mDebugSendToCerr(false) - ,mDoRunDebugshow(false) -{ } - -vector<string> cRunOptions::ExecuteRunoptionsAndRemoveThem(const vector<string> & args) { - vector<string> arg_clear; // will store only the arguments that are not removed - - for (auto arg : args) { - bool thisIsRunoption=false; - - if (arg.size()>0) { - if (arg.at(0) == '+') thisIsRunoption=true; - } - - if (thisIsRunoption) Exec(arg); // *** - if (! thisIsRunoption) arg_clear.push_back(arg); - } - - Normalize(); - - return arg_clear; -} - -void cRunOptions::Exec(const string & runoption) { // eg: Exec("+debug"); - if (runoption == "+nodebug") { mDebug=false; } - else if (runoption == "+debug") { mDebug=true; } - else if (runoption == "+debugcerr") { mDebug=true; mDebugSendToCerr=true; } - else if (runoption == "+debugfile") { mDebug=true; mDebugSendToFile=true; } - else if (runoption == "+demo") { mRunMode=eRunModeDemo; } - else if (runoption == "+normal") { mRunMode=eRunModeNormal; } - else if (runoption == "+current") { mRunMode=eRunModeCurrent; } - else if (runoption == "+debugshow") { mDebug=true; mDebugSendToCerr=true; mDoRunDebugshow=true; } - else { - cerr << "Unknown runoption in Exec: '" << runoption << "'" << endl; - throw std::runtime_error("Unknown runoption"); - } - // cerr<<"debug="<<mDebug<<endl; -} - -void cRunOptions::Normalize() { - if (mDebug) { - if (!( mDebugSendToFile || mDebugSendToCerr )) mDebugSendToCerr=true; // if debug is on then send to something, e.g. to cerr - } -} - - -cRunOptions gRunOptions; // (extern) - -} // namespace OT - - |
