Commit 2b16ea2c authored by Vladimír Čunát's avatar Vladimír Čunát

rename: kr_verbose_do_log -> kr_verbose_status

Now that we renamed "debug" to "verbose", the old name didn't seem very
suitable anymore; this new identifier haven't got to master yet.
parent d0150ffa
......@@ -143,7 +143,7 @@ static int l_verbose(lua_State *L)
if (lua_isboolean(L, 1) || lua_isnumber(L, 1)) {
kr_verbose_set(lua_toboolean(L, 1));
}
lua_pushboolean(L, kr_verbose_do_log);
lua_pushboolean(L, kr_verbose_status);
return 1;
}
......
......@@ -347,7 +347,7 @@ static int run_worker(uv_loop_t *loop, struct engine *engine, fd_array_t *ipc_se
}
memcpy(&engine->ipc_set, ipc_set, sizeof(*ipc_set));
tls_setup_logging(kr_verbose_do_log);
tls_setup_logging(kr_verbose_status);
/* Notify supervisor. */
#ifdef HAS_SYSTEMD
sd_notify(0, "READY=1");
......
......@@ -35,12 +35,12 @@
/* Always compile-in log symbols, even if disabled. */
#undef kr_verbose_do_log
#undef kr_verbose_status
#undef kr_verbose_set
#undef kr_log_verbose
/* Logging & debugging */
bool kr_verbose_do_log = false;
bool kr_verbose_status = false;
/** @internal CSPRNG context */
static isaac_ctx ISAAC;
......@@ -74,14 +74,14 @@ static inline int u16tostr(uint8_t *dst, uint16_t num)
bool kr_verbose_set(bool status)
{
#ifndef NOVERBOSELOG
kr_verbose_do_log = status;
kr_verbose_status = status;
#endif
return kr_verbose_do_log;
return kr_verbose_status;
}
void kr_log_verbose(const char *fmt, ...)
{
if (kr_verbose_do_log) {
if (kr_verbose_status) {
va_list args;
va_start(args, fmt);
vprintf(fmt, args);
......
......@@ -34,7 +34,7 @@
/* Always export these, but override direct calls by macros conditionally. */
/** Whether in --verbose mode. Only use this for reading. */
KR_EXPORT extern bool kr_verbose_do_log;
KR_EXPORT extern bool kr_verbose_status;
/** Set --verbose mode. Not available if compiled with -DNOVERBOSELOG. */
KR_EXPORT bool kr_verbose_set(bool status);
......@@ -44,12 +44,12 @@ KR_EXPORT void kr_log_verbose(const char *fmt, ...);
#ifdef NOVERBOSELOG
/* Efficient compile-time disabling of verbose messages. */
#define kr_verbose_do_log false
#define kr_verbose_status false
#define kr_verbose_set(x)
#endif
/** Block run in --verbose mode; optimized when not run. */
#define WITH_VERBOSE if(__builtin_expect(kr_verbose_do_log, false))
#define WITH_VERBOSE if(__builtin_expect(kr_verbose_status, false))
#define kr_log_verbose WITH_VERBOSE kr_log_verbose
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment