mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-02 12:01:32 +01:00
Adjust for changed macro names in libgpg-error master.
* common/logging.h (GPGRT_LOGLVL_): New replacement macros for older libgpg-error versions. -- Updates-commit: b56dfdfc1865ceb7c3c025d79996e049faee7fdf Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
6d14be22a1
commit
34defc9bce
@ -93,7 +93,7 @@ my_libassuan_log_handler (assuan_context_t ctx, void *hook,
|
||||
return 0; /* Temporary disabled. */
|
||||
|
||||
if (msg)
|
||||
log_string (GPGRT_LOG_DEBUG, msg);
|
||||
log_string (GPGRT_LOGLVL_DEBUG, msg);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@ -48,7 +48,8 @@ static inline void bug_at (const char *file, int line, const char *func)
|
||||
static inline void
|
||||
bug_at (const char *file, int line, const char *func)
|
||||
{
|
||||
gpgrt_log (GPGRT_LOG_BUG, "there is a bug at %s:%d:%s\n", file, line, func);
|
||||
gpgrt_log (GPGRT_LOGLVL_BUG, "there is a bug at %s:%d:%s\n",
|
||||
file, line, func);
|
||||
abort ();
|
||||
}
|
||||
# else
|
||||
@ -58,7 +59,7 @@ static inline void bug_at (const char *file, int line)
|
||||
static inline void
|
||||
bug_at (const char *file, int line)
|
||||
{
|
||||
gpgrt_log (GPGRT_LOG_BUG, "there is a bug at %s:%d\n", file, line);
|
||||
gpgrt_log (GPGRT_LOGLVL_BUG, "there is a bug at %s:%d\n", file, line);
|
||||
abort ();
|
||||
}
|
||||
# endif /*!GPGRT_HAVE_MACRO_FUNCTION*/
|
||||
@ -116,6 +117,15 @@ enum jnlib_log_levels {
|
||||
GPGRT_LOG_BUG,
|
||||
GPGRT_LOG_DEBUG
|
||||
};
|
||||
#define GPGRT_LOGLVL_BEGIN GPGRT_LOG_BEGIN
|
||||
#define GPGRT_LOGLVL_CONT GPGRT_LOG_CONT
|
||||
#define GPGRT_LOGLVL_INFO GPGRT_LOG_INFO
|
||||
#define GPGRT_LOGLVL_WARN GPGRT_LOG_WARN
|
||||
#define GPGRT_LOGLVL_ERROR GPGRT_LOG_ERROR
|
||||
#define GPGRT_LOGLVL_FATAL GPGRT_LOG_FATAL
|
||||
#define GPGRT_LOGLVL_BUG GPGRT_LOG_BUG
|
||||
#define GPGRT_LOGLVL_DEBUG GPGRT_LOG_DEBUG
|
||||
|
||||
void log_log (int level, const char *fmt, ...) GPGRT_ATTR_PRINTF(2,3);
|
||||
void log_logv (int level, const char *fmt, va_list arg_ptr);
|
||||
void log_logv_prefix (int level, const char *prefix,
|
||||
|
@ -45,14 +45,14 @@ my_gcry_logger (void *dummy, int level, const char *fmt, va_list arg_ptr)
|
||||
/* Map the log levels. */
|
||||
switch (level)
|
||||
{
|
||||
case GCRY_LOG_CONT: level = GPGRT_LOG_CONT; break;
|
||||
case GCRY_LOG_INFO: level = GPGRT_LOG_INFO; break;
|
||||
case GCRY_LOG_WARN: level = GPGRT_LOG_WARN; break;
|
||||
case GCRY_LOG_ERROR:level = GPGRT_LOG_ERROR; break;
|
||||
case GCRY_LOG_FATAL:level = GPGRT_LOG_FATAL; break;
|
||||
case GCRY_LOG_BUG: level = GPGRT_LOG_BUG; break;
|
||||
case GCRY_LOG_DEBUG:level = GPGRT_LOG_DEBUG; break;
|
||||
default: level = GPGRT_LOG_ERROR; break;
|
||||
case GCRY_LOG_CONT: level = GPGRT_LOGLVL_CONT; break;
|
||||
case GCRY_LOG_INFO: level = GPGRT_LOGLVL_INFO; break;
|
||||
case GCRY_LOG_WARN: level = GPGRT_LOGLVL_WARN; break;
|
||||
case GCRY_LOG_ERROR:level = GPGRT_LOGLVL_ERROR; break;
|
||||
case GCRY_LOG_FATAL:level = GPGRT_LOGLVL_FATAL; break;
|
||||
case GCRY_LOG_BUG: level = GPGRT_LOGLVL_BUG; break;
|
||||
case GCRY_LOG_DEBUG:level = GPGRT_LOGLVL_DEBUG; break;
|
||||
default: level = GPGRT_LOGLVL_ERROR; break;
|
||||
}
|
||||
log_logv (level, fmt, arg_ptr);
|
||||
}
|
||||
|
@ -781,12 +781,12 @@ my_ntbtls_log_handler (void *opaque, int level, const char *fmt, va_list argv)
|
||||
(void)opaque;
|
||||
|
||||
if (level == -1)
|
||||
log_logv_prefix (GPGRT_LOG_INFO, "ntbtls: ", fmt, argv);
|
||||
log_logv_prefix (GPGRT_LOGLVL_INFO, "ntbtls: ", fmt, argv);
|
||||
else
|
||||
{
|
||||
char prefix[10+20];
|
||||
snprintf (prefix, sizeof prefix, "ntbtls(%d): ", level);
|
||||
log_logv_prefix (GPGRT_LOG_DEBUG, prefix, fmt, argv);
|
||||
log_logv_prefix (GPGRT_LOGLVL_DEBUG, prefix, fmt, argv);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -195,7 +195,7 @@ warn_version_mismatch (assuan_context_t ctx, const char *servername, int mode)
|
||||
err = get_assuan_server_version (ctx, mode, &serverversion);
|
||||
if (err)
|
||||
log_log (gpg_err_code (err) == GPG_ERR_NOT_SUPPORTED?
|
||||
GPGRT_LOG_INFO : GPGRT_LOG_ERROR,
|
||||
GPGRT_LOGLVL_INFO : GPGRT_LOGLVL_ERROR,
|
||||
_("error getting version from '%s': %s\n"),
|
||||
servername, gpg_strerror (err));
|
||||
else if (compare_version_strings (serverversion, myversion) < 0)
|
||||
|
@ -1142,7 +1142,7 @@ change_passphrase (ctrl_t ctrl, kbnode_t keyblock)
|
||||
if (err)
|
||||
log_log ((gpg_err_code (err) == GPG_ERR_CANCELED
|
||||
|| gpg_err_code (err) == GPG_ERR_FULLY_CANCELED)
|
||||
? GPGRT_LOG_INFO : GPGRT_LOG_ERROR,
|
||||
? GPGRT_LOGLVL_INFO : GPGRT_LOGLVL_ERROR,
|
||||
_("key %s: error changing passphrase: %s\n"),
|
||||
keystr_with_sub (keyid, subid),
|
||||
gpg_strerror (err));
|
||||
|
@ -396,7 +396,7 @@ print_further_info (const char *format, ...)
|
||||
|
||||
log_info (_("(further info: "));
|
||||
va_start (arg_ptr, format);
|
||||
log_logv (GPGRT_LOG_CONT, format, arg_ptr);
|
||||
log_logv (GPGRT_LOGLVL_CONT, format, arg_ptr);
|
||||
va_end (arg_ptr);
|
||||
log_printf (")\n");
|
||||
}
|
||||
|
@ -3214,7 +3214,7 @@ show_statistics (tofu_dbs_t dbs,
|
||||
*p = ' ';
|
||||
}
|
||||
|
||||
log_string (GPGRT_LOG_INFO, msg);
|
||||
log_string (GPGRT_LOGLVL_INFO, msg);
|
||||
xfree (msg);
|
||||
|
||||
if (policy == TOFU_POLICY_AUTO)
|
||||
@ -3279,7 +3279,7 @@ show_warning (const char *fingerprint, strlist_t user_id_list)
|
||||
log_fatal ("format failed: %s\n",
|
||||
gpg_strerror (gpg_error_from_syserror()));
|
||||
xfree (tmpmsg);
|
||||
log_string (GPGRT_LOG_INFO, text);
|
||||
log_string (GPGRT_LOGLVL_INFO, text);
|
||||
xfree (text);
|
||||
|
||||
es_free (set_policy_command);
|
||||
|
@ -137,14 +137,14 @@ my_gcry_logger (void *dummy, int level, const char *fmt, va_list arg_ptr)
|
||||
/* Map the log levels. */
|
||||
switch (level)
|
||||
{
|
||||
case GCRY_LOG_CONT: level = GPGRT_LOG_CONT; break;
|
||||
case GCRY_LOG_INFO: level = GPGRT_LOG_INFO; break;
|
||||
case GCRY_LOG_WARN: level = GPGRT_LOG_WARN; break;
|
||||
case GCRY_LOG_ERROR:level = GPGRT_LOG_ERROR; break;
|
||||
case GCRY_LOG_FATAL:level = GPGRT_LOG_FATAL; break;
|
||||
case GCRY_LOG_BUG: level = GPGRT_LOG_BUG; break;
|
||||
case GCRY_LOG_DEBUG:level = GPGRT_LOG_DEBUG; break;
|
||||
default: level = GPGRT_LOG_ERROR; break;
|
||||
case GCRY_LOG_CONT: level = GPGRT_LOGLVL_CONT; break;
|
||||
case GCRY_LOG_INFO: level = GPGRT_LOGLVL_INFO; break;
|
||||
case GCRY_LOG_WARN: level = GPGRT_LOGLVL_WARN; break;
|
||||
case GCRY_LOG_ERROR:level = GPGRT_LOGLVL_ERROR; break;
|
||||
case GCRY_LOG_FATAL:level = GPGRT_LOGLVL_FATAL; break;
|
||||
case GCRY_LOG_BUG: level = GPGRT_LOGLVL_BUG; break;
|
||||
case GCRY_LOG_DEBUG:level = GPGRT_LOGLVL_DEBUG; break;
|
||||
default: level = GPGRT_LOGLVL_ERROR; break;
|
||||
}
|
||||
log_logv (level, fmt, arg_ptr);
|
||||
}
|
||||
|
@ -119,7 +119,8 @@ do_list (int is_error, int listmode, estream_t fp, const char *format, ...)
|
||||
}
|
||||
else
|
||||
{
|
||||
log_logv (is_error? GPGRT_LOG_ERROR: GPGRT_LOG_INFO, format, arg_ptr);
|
||||
log_logv (is_error? GPGRT_LOGLVL_ERROR: GPGRT_LOGLVL_INFO,
|
||||
format, arg_ptr);
|
||||
log_printf ("\n");
|
||||
}
|
||||
va_end (arg_ptr);
|
||||
|
@ -87,7 +87,7 @@ gc_error (int status, int errnum, const char *fmt, ...)
|
||||
va_list arg_ptr;
|
||||
|
||||
va_start (arg_ptr, fmt);
|
||||
log_logv (GPGRT_LOG_ERROR, fmt, arg_ptr);
|
||||
log_logv (GPGRT_LOGLVL_ERROR, fmt, arg_ptr);
|
||||
va_end (arg_ptr);
|
||||
|
||||
if (errnum)
|
||||
|
Loading…
x
Reference in New Issue
Block a user