diff --git a/src/box/errcode.h b/src/box/errcode.h index cc09e1a9007265ce775341bbb463c752815d3a2f..142e931a2902a5beff20eb864fb53a7f6e8f56ac 100644 --- a/src/box/errcode.h +++ b/src/box/errcode.h @@ -150,8 +150,8 @@ struct errcode_record { /* 96 */_(ER_GUEST_USER_PASSWORD, 2, "Setting password for guest user has no effect") \ /* 97 */_(ER_TRANSACTION_CONFLICT, 2, "Transaction has been aborted by conflict") \ /* 98 */_(ER_UNSUPPORTED_ROLE_PRIV, 2, "Unsupported role privilege '%s'") \ - /* 98 */_(ER_LOAD_FUNCTION, 2, "Failed to dynamically load function '%s': %s") \ - /* 98 */_(ER_FUNCTION_LANGUAGE, 2, "Unsupported language '%s' specified for function '%s'") \ + /* 99 */_(ER_LOAD_FUNCTION, 2, "Failed to dynamically load function '%s': %s") \ + /*100 */_(ER_FUNCTION_LANGUAGE, 2, "Unsupported language '%s' specified for function '%s'") \ /* * !IMPORTANT! Please follow instructions at start of the file diff --git a/src/fiber.cc b/src/fiber.cc index 70dd95f9e0f1bbcc4e44c12348322e2120e21c8d..88889dcba2fe03bdcf717de49ccb0a573e22bf64 100644 --- a/src/fiber.cc +++ b/src/fiber.cc @@ -66,6 +66,7 @@ fiber_call(struct fiber *callee) assert(cord->call_stack_depth < FIBER_CALL_STACK); assert(caller); + assert(caller != callee); cord->call_stack_depth++; cord->fiber = callee; diff --git a/src/lua/log.lua b/src/lua/log.lua index ae638a2866751c7bb3ea35a6214251ef521341b1..d086bcc6dfb7b0c18c6dc8030e851d99f7bc9710 100644 --- a/src/lua/log.lua +++ b/src/lua/log.lua @@ -19,9 +19,14 @@ ffi.cdef[[ }; pid_t logger_pid; + extern int log_level; ]] local function say(level, fmt, ...) + if ffi.C.log_level < level then +-- don't waste cycles on debug.getinfo() + return + end local debug = require('debug') local str = string.format(tostring(fmt), ...) local frame = debug.getinfo(3, "Sl") diff --git a/src/say.cc b/src/say.cc index ec96fddcf17b78bb3a1714cd5c116f27d15cb343..9935e91a963194482d8133164958b61dc21435bc 100644 --- a/src/say.cc +++ b/src/say.cc @@ -48,8 +48,7 @@ pid_t logger_pid; static bool booting = true; static bool logger_background = true; static const char *binary_filename; -static int log_level_default = S_INFO; -static int *log_level = &log_level_default; +int log_level = S_INFO; static void sayf(int level, const char *filename, int line, const char *error, @@ -89,7 +88,7 @@ say_init(const char *argv0) void say_set_log_level(int new_level) { - *log_level = new_level; + log_level = new_level; } /** @@ -216,7 +215,7 @@ say_init_file() void say_logger_init(const char *path, int level, int nonblock, int background) { - *log_level = level; + log_level = level; logger_nonblock = nonblock; logger_background = background; setvbuf(stderr, NULL, _IONBF, 0); @@ -307,7 +306,7 @@ static void sayf(int level, const char *filename, int line, const char *error, const char *format, ...) { int errsv = errno; /* Preserve the errno. */ - if (*log_level < level) + if (log_level < level) return; va_list ap; va_start(ap, format); diff --git a/src/say.h b/src/say.h index c2f74ed9ec107641b8c2621160d0b5c7e48d92e4..1896958e92a0f7ba31befd51e1d785a59d118e1b 100644 --- a/src/say.h +++ b/src/say.h @@ -52,6 +52,7 @@ enum say_level { /** \endcond public */ extern int log_fd; +extern int log_level; extern pid_t logger_pid; void