Skip to content
Snippets Groups Projects
Commit fbfa5aaf authored by Nikita Pettik's avatar Nikita Pettik Committed by Vladimir Davydov
Browse files

say: get rid of say_log_level() macro family

It is unused and misleading. Let's remove them so that now we have
single entry point for log subsystem - `say()`.

NO_DOC=<Refactoring>
NO_CHANGELOG=<Refactoring>
NO_TEST=<Refactoring>
parent 3d39d23a
No related branches found
No related tags found
No related merge requests found
......@@ -417,62 +417,6 @@ enum {
#define say_info_ratelimited(format, ...) \
say_ratelimited(S_INFO, NULL, format, ##__VA_ARGS__)
/**
* Format and print a message to Tarantool log file.
*
* \param log (struct log *) - logger object
* \param level (int) - log level (see enum \link say_level \endlink)
* \param format (const char * ) - printf()-like format string
* \param ... - format arguments
* \sa printf()
* \sa enum say_level
*/
#define log_say_level(log, _level, format, ...) ({ \
if (_level <= log->level) \
log_say(log, _level, __FILE__, __LINE__,\
format, ##__VA_ARGS__); })
/**
* Format and print a message to specified logger.
*
* \param log (struct log *) - logger object
* \param format (const char * ) - printf()-like format string
* \param ... - format arguments
* \sa printf()
* \sa enum say_level
* Example:
* \code
* log_say_info("Some useful information: %s", status);
* \endcode
*/
#define log_say_error(log, format, ...) \
log_say_level(log, S_ERROR, NULL, format, ##__VA_ARGS__)
/** \copydoc log_say_error() */
#define log_say_crit(log, format, ...) \
log_say_level(log, S_CRIT, NULL, format, ##__VA_ARGS__)
/** \copydoc log_say_error() */
#define log_say_warn(log, format, ...) \
log_say_level(log, S_WARN, NULL, format, ##__VA_ARGS__)
/** \copydoc log_say_error() */
#define log_say_info(log, format, ...) \
log_say_level(log, S_INFO, NULL, format, ##__VA_ARGS__)
/** \copydoc log_say_error() */
#define log_say_verbose(log, format, ...) \
log_say_level(log, S_VERBOSE, NULL, format, ##__VA_ARGS__)
/** \copydoc log_say_error() */
#define log_say_debug(log, format, ...) \
log_say_level(log, S_DEBUG, NULL, format, ##__VA_ARGS__)
/** \copydoc log_say_error(). */
#define log_say_syserror(log, format, ...) \
log_say_level(log, S_SYSERROR, strerror(errno), format, ##__VA_ARGS__)
/* internals, for unit testing */
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment