Skip to content
Snippets Groups Projects
Commit 712108d2 authored by Kirill Yukhin's avatar Kirill Yukhin
Browse files

Merge branch '1.9' into 1.10

parents a2d7643c 1046f851
No related branches found
No related tags found
No related merge requests found
...@@ -502,6 +502,11 @@ log_syslog_init(struct log *log, const char *init_str) ...@@ -502,6 +502,11 @@ log_syslog_init(struct log *log, const char *init_str)
log->syslog_ident = strdup("tarantool"); log->syslog_ident = strdup("tarantool");
else else
log->syslog_ident = strdup(opts.identity); log->syslog_ident = strdup(opts.identity);
if (log->syslog_ident == NULL) {
diag_set(OutOfMemory, strlen(opts.identity), "malloc",
"log->syslog_ident");
return -1;
}
if (opts.facility == syslog_facility_MAX) if (opts.facility == syslog_facility_MAX)
log->syslog_facility = SYSLOG_LOCAL7; log->syslog_facility = SYSLOG_LOCAL7;
......
...@@ -261,26 +261,28 @@ CFORMAT(printf, 5, 0) extern sayfunc_t _say; ...@@ -261,26 +261,28 @@ CFORMAT(printf, 5, 0) extern sayfunc_t _say;
* \param level (int) - log level (see enum \link say_level \endlink) * \param level (int) - log level (see enum \link say_level \endlink)
* \param file (const char * ) - file name to print * \param file (const char * ) - file name to print
* \param line (int) - line number to print * \param line (int) - line number to print
* \param error (const char * ) - error description, may be NULL
* \param format (const char * ) - printf()-like format string * \param format (const char * ) - printf()-like format string
* \param ... - format arguments * \param ... - format arguments
* \sa printf() * \sa printf()
* \sa enum say_level * \sa enum say_level
*/ */
#define say_file_line(level, file, line, format, ...) ({ \ #define say_file_line(level, file, line, error, format, ...) ({ \
if (say_log_level_is_enabled(level)) \ if (say_log_level_is_enabled(level)) \
_say(level, file, line, format, ##__VA_ARGS__); }) _say(level, file, line, error, format, ##__VA_ARGS__); })
/** /**
* Format and print a message to Tarantool log file. * Format and print a message to Tarantool log file.
* *
* \param level (int) - log level (see enum \link say_level \endlink) * \param level (int) - log level (see enum \link say_level \endlink)
* \param error (const char * ) - error description, may be NULL
* \param format (const char * ) - printf()-like format string * \param format (const char * ) - printf()-like format string
* \param ... - format arguments * \param ... - format arguments
* \sa printf() * \sa printf()
* \sa enum say_level * \sa enum say_level
*/ */
#define say(level, format, ...) ({ \ #define say(level, error, format, ...) ({ \
say_file_line(level, __FILE__, __LINE__, format, ##__VA_ARGS__); }) say_file_line(level, __FILE__, __LINE__, error, format, ##__VA_ARGS__); })
/** /**
* Format and print a message to Tarantool log file. * Format and print a message to Tarantool log file.
......
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