diff options
author | Werner Koch <wk@gnupg.org> | 2017-11-17 09:37:54 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2017-11-17 09:48:30 +0100 |
commit | 1b653e7f37e2eb2a8f590a43651eb8aecbe8756e (patch) | |
tree | 07981a1260494dc7a94e3e266743fb58070416a2 /src/gpg-error.vers | |
parent | 9c904765c9b2b75e73b196b381470f0fb2f3b458 (diff) | |
download | libgpg-error-1b653e7f37e2eb2a8f590a43651eb8aecbe8756e.tar.gz |
core: Add logging API.
* src/visibility.c (gpgrt_get_errorcount): New API.
(gpgrt_inc_errorcount): New API.
(gpgrt_log_set_sink): New API.
(gpgrt_log_set_socket_dir_cb): New API.
(gpgrt_log_set_pid_suffix_cb): New API.
(gpgrt_log_set_prefix): New API.
(gpgrt_log_get_prefix): New API.
(gpgrt_log_test_fd): New API.
(gpgrt_log_get_fd): New API.
(gpgrt_log_get_stream): New API.
(gpgrt_log): New API.
(gpgrt_logv): New API.
(gpgrt_logv_prefix): New API.
(gpgrt_log_string): New API.
(gpgrt_log_info): New API.
(gpgrt_log_error): New API.
(gpgrt_log_fatal): New API.
(gpgrt_log_bug): New API.
(gpgrt_log_debug): New API.
(gpgrt_log_debug_string): New API.
(gpgrt_log_printf): New API.
(gpgrt_log_flush): New API.
(gpgrt_log_printhex): New API.
(gpgrt_log_clock): New API.
(_gpgrt_log_assert): New function for the ABI.
* src/visibility.h: Add corresponding macros.
* src/gpg-error.def.in: Add new functions.
* src/gpg-error.vers: Add new functions.
* src/gpg-error.h.in (GPGRT_LOG_WITH_PREFIX): New constant.
(GPGRT_LOG_WITH_TIME): New constant.
(GPGRT_LOG_WITH_PID): New constant.
(GPGRT_LOG_RUN_DETACHED): New constant.
(GPGRT_LOG_NO_REGISTRY): New constant.
(GPGRT_LOG_BEGIN): New enum value.
(GPGRT_LOG_CONT): New enum value.
(GPGRT_LOG_INFO): New enum value.
(GPGRT_LOG_WARN): New enum value.
(GPGRT_LOG_ERROR): New enum value.
(GPGRT_LOG_FATAL): New enum value.
(GPGRT_LOG_BUG): New enum value.
(GPGRT_LOG_DEBUG): New enum value.
(log_get_errorcount, log_inc_errorcount, log_set_file, log_set_fd)
(log_set_stream, log_set_socket_dir_cb, log_set_pid_suffix_cb)
(log_set_prefix, log_get_prefix, log_test_fd, log_get_fd)
(log_get_stream, log_log, log_logv, log_logv_prefix, log_string)
(log_bug, log_fatal, log_error, log_info, log_debug, log_debug_string)
(log_printf, log_printhex, log_clock)
(log_flush) [GPGRT_ENABLE_LOG_MACROS]: New wrapper macros.
(gpgrt_assert): New macro.
* src/gpgrt-int.h: Add prototypes for logging.c.
(gpgrt_assert): Redefine for internal use.
* src/logging.h: Remove.
* src/logging.c: Include gpgrt-int.h instead of the stuff from GnuPG.
Use _gpgrt malloc funcsions and the internal versions of the estream
functions. Rename all public fucntions with a _gpgrt_ prefix.
(print_prefix): Return the printed length.
(_gpgrt_logv_internal): Ditto.
(_gpgrt_log_printhex): Change order of args and turn into a printf
like function.
(_gpgrt_logv_printhex): New. Take the core of the former
log_printhex.
(_gpgrt_log_clock): Turn into a printf like functions.
(_gpgrt_logv_clock): New. Take the core of the former log_clock.
--
This logging API is a slightly modified version of what we are using
in GnuPG.
Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'src/gpg-error.vers')
-rw-r--r-- | src/gpg-error.vers | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/gpg-error.vers b/src/gpg-error.vers index e44128c..6cce976 100644 --- a/src/gpg-error.vers +++ b/src/gpg-error.vers @@ -15,6 +15,7 @@ # # You should have received a copy of the GNU Lesser General Public # License along with this program; if not, see <https://www.gnu.org/licenses/>. +# SPDX-License-Identifier: LGPL-2.1+ # # NOTE: When adding new functions, please make sure to add them to # visibility.h and gpg-error.def.in as well. @@ -130,6 +131,33 @@ GPG_ERROR_1.0 { gpgrt_b64dec_proc; gpgrt_b64dec_finish; + gpgrt_get_errorcount; + gpgrt_inc_errorcount; + gpgrt_log_set_sink; + gpgrt_log_set_socket_dir_cb; + gpgrt_log_set_pid_suffix_cb; + gpgrt_log_set_prefix; + gpgrt_log_get_prefix; + gpgrt_log_test_fd; + gpgrt_log_get_fd; + gpgrt_log_get_stream; + gpgrt_log; + gpgrt_logv; + gpgrt_logv_prefix; + gpgrt_log_string; + gpgrt_log_bug; + gpgrt_log_fatal; + gpgrt_log_error; + gpgrt_log_info; + gpgrt_log_debug; + gpgrt_log_debug_string; + gpgrt_log_printf; + gpgrt_log_printhex; + gpgrt_log_clock; + gpgrt_log_flush; + _gpgrt_log_assert; + + local: *; }; |