Browse Source

ckdb - option to disable writing the ckdb-db logs

master
kanoi 8 years ago
parent
commit
ac3e2368b5
  1. 14
      src/ckdb.c
  2. 2
      src/ckdb.h

14
src/ckdb.c

@ -447,6 +447,8 @@ static pthread_cond_t f_ioqueue_waitcond;
K_LIST *logqueue_free; K_LIST *logqueue_free;
K_STORE *logqueue_store; K_STORE *logqueue_store;
static bool db_logger = true;
// NAMERAM // NAMERAM
K_LIST *nameram_free; K_LIST *nameram_free;
K_STORE *nameram_store; K_STORE *nameram_store;
@ -5713,9 +5715,10 @@ static void *logger(__maybe_unused void *arg)
K_WUNLOCK(logqueue_free); K_WUNLOCK(logqueue_free);
while (lq_item) { while (lq_item) {
DATA_LOGQUEUE(lq, lq_item); DATA_LOGQUEUE(lq, lq_item);
if (lq->db) if (lq->db) {
if (db_logger)
LOGFILE(lq->msg, logname_db); LOGFILE(lq->msg, logname_db);
else } else
LOGFILE(lq->msg, logname_io); LOGFILE(lq->msg, logname_io);
FREENULL(lq->msg); FREENULL(lq->msg);
@ -8950,6 +8953,8 @@ static struct option long_options[] = {
{ "btc-user", required_argument, 0, 'U' }, { "btc-user", required_argument, 0, 'U' },
{ "version", no_argument, 0, 'v' }, { "version", no_argument, 0, 'v' },
{ "workinfoid", required_argument, 0, 'w' }, { "workinfoid", required_argument, 0, 'w' },
// Disable writing to the db-log file
{ "no-db-log", no_argument, 0, 'x' },
{ "confirm", no_argument, 0, 'y' }, { "confirm", no_argument, 0, 'y' },
{ "confirmrange", required_argument, 0, 'Y' }, { "confirmrange", required_argument, 0, 'Y' },
{ 0, 0, 0, 0 } { 0, 0, 0, 0 }
@ -8990,7 +8995,7 @@ int main(int argc, char **argv)
memset(&ckpcmd, 0, sizeof(ckp)); memset(&ckpcmd, 0, sizeof(ckp));
ckp.loglevel = LOG_NOTICE; ckp.loglevel = LOG_NOTICE;
while ((c = getopt_long(argc, argv, "a:Ab:B:c:d:D:f:ghi:IkK:l:L:mM:n:N:o:p:P:q:Q:r:R:s:S:t:Tu:U:vw:yY:", long_options, &i)) != -1) { while ((c = getopt_long(argc, argv, "a:Ab:B:c:d:D:f:ghi:IkK:l:L:mM:n:N:o:p:P:q:Q:r:R:s:S:t:Tu:U:vw:xyY:", long_options, &i)) != -1) {
switch(c) { switch(c) {
case '?': case '?':
case ':': case ':':
@ -9256,6 +9261,9 @@ int main(int argc, char **argv)
dbload_workinfoid_start = start; dbload_workinfoid_start = start;
} }
break; break;
case 'x':
db_logger = false;
break;
case 'y': case 'y':
confirm_sharesummary = true; confirm_sharesummary = true;
break; break;

2
src/ckdb.h

@ -58,7 +58,7 @@
#define DB_VLOCK "1" #define DB_VLOCK "1"
#define DB_VERSION "1.0.7" #define DB_VERSION "1.0.7"
#define CKDB_VERSION DB_VERSION"-2.445" #define CKDB_VERSION DB_VERSION"-2.446"
#define WHERE_FFL " - from %s %s() line %d" #define WHERE_FFL " - from %s %s() line %d"
#define WHERE_FFL_HERE __FILE__, __func__, __LINE__ #define WHERE_FFL_HERE __FILE__, __func__, __LINE__

Loading…
Cancel
Save