Skip to content
This repository was archived by the owner on Apr 24, 2022. It is now read-only.

Commit a94973d

Browse files
committedSep 5, 2018
Use symbol for max verbosity setting
1 parent d58ef27 commit a94973d

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed
 

‎CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
2323
- AMD auto kernel selection. Try bin first, if not fall back to OpenCL.
2424
- API: New method `miner_setverbosity`. [#1382](https://github.com/ethereum-mining/ethminer/pull/1382).
2525
- Implemented fast job switch algorithm on AMD reducing switch time to 1-2 milliseconds.
26-
- Added localization support for output number formatting
26+
- Added localization support for output number formatting.
27+
- Changed the --verbosity to allow individual enable/disable of logging features.
2728

2829
### Removed
2930

‎ethminer/main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ class MinerCLI
212212
<< ", log additional debug info = " << LOG_DEBUG;
213213
app.add_option("-v,--verbosity", g_logOptions, logOptions.str(), true)
214214
->group(CommonGroup)
215-
->check(CLI::Range(15));
215+
->check(CLI::Range(LOG_ALL));
216216

217217
app.add_option("--farm-recheck", m_farmRecheckPeriod,
218218
"Set check interval in milliseconds for changed work", true)

‎libapicore/ApiServer.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -686,10 +686,11 @@ void ApiConnection::processRequest(Json::Value& jRequest, Json::Value& jResponse
686686
if (!getRequestValue("verbosity", verbosity, jRequestParams, false, jResponse))
687687
return;
688688

689-
if (verbosity > 9)
689+
if (verbosity > LOG_ALL)
690690
{
691691
jResponse["error"]["code"] = -422;
692-
jResponse["error"]["message"] = "Verbosity out of bounds (0-9)";
692+
jResponse["error"]["message"] =
693+
"Verbosity out of bounds (0-" + to_string(LOG_ALL) + ")";
693694
return;
694695
}
695696
cnote << "Setting verbosity level to " << verbosity;

‎libdevcore/Log.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ using namespace dev;
3232
//⊳⊲◀▶■▣▢□▷◁▧▨▩▲◆◉◈◇◎●◍◌○◼☑☒☎☢☣☰☀♽♥♠✩✭❓✔✓✖✕✘✓✔✅⚒⚡⦸⬌∅⁕«««»»»⚙
3333

3434
// Logging
35-
int g_logOptions = 0;
35+
unsigned g_logOptions = 0;
3636
bool g_logNoColor = false;
3737
bool g_logSyslog = false;
3838

‎libdevcore/Log.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
#define LOG_JSON 2
3838
#define LOG_PER_GPU 4
3939
#define LOG_DEBUG 8
40-
extern int g_logOptions;
40+
#define LOG_ALL (LOG_SWITCH_TIME | LOG_JSON | LOG_PER_GPU | LOG_DEBUG)
41+
extern unsigned g_logOptions;
4142
extern bool g_logNoColor;
4243
extern bool g_logSyslog;
4344

0 commit comments

Comments
 (0)
This repository has been archived.