[Pkg-voip-commits] [bctoolbox] 17/60: Offer the choice to create a defaut logger or not a initialization
Bernhard Schmidt
berni at moszumanska.debian.org
Sun Oct 15 22:42:24 UTC 2017
This is an automated email from the git hooks/post-receive script.
berni pushed a commit to branch debian/sid
in repository bctoolbox.
commit 1180ba9cb43bddf7de820b78f7548ce780514d61
Merge: f89b7c2 b5b46a4
Author: Benjamin Reis <benjamin.reis at belledonne-communications.com>
Date: Tue Apr 4 11:06:47 2017 +0200
Offer the choice to create a defaut logger or not a initialization
CMakeLists.txt | 2 +-
cmake/FindBCUnit.cmake | 68 --------------------------------------
include/bctoolbox/logging.h | 30 ++++++++---------
include/bctoolbox/port.h | 14 ++++++++
src/logging/logging.c | 80 +++++++++++++++++++++++++--------------------
src/utils/port.c | 31 ++++++++++++++++++
tester/bctoolbox_tester.c | 13 ++++----
tester/port.c | 19 ++++++-----
8 files changed, 122 insertions(+), 135 deletions(-)
diff --cc src/logging/logging.c
index 5399deb,4fdfbfb..baf90d9
--- a/src/logging/logging.c
+++ b/src/logging/logging.c
@@@ -61,19 -70,18 +70,20 @@@ typedef struct _bctbx_file_log_handler_
uint64_t max_size;
uint64_t size;
FILE* file;
- }BctoolboxFileLogHandler;
+ } bctbx_file_log_handler_t;
- static BctoolboxLogger __bctbx_logger = { NULL, BCTBX_LOG_WARNING|BCTBX_LOG_ERROR|BCTBX_LOG_FATAL, 0};
+ static bctbx_logger_t __bctbx_logger = { NULL, BCTBX_LOG_WARNING|BCTBX_LOG_ERROR|BCTBX_LOG_FATAL, 0};
static unsigned int bctbx_init_logger_refcount = 0;
-void bctbx_init_logger(void){
- bctbx_log_handler_t* handler;
++
+void bctbx_init_logger(bool_t create){
if (bctbx_init_logger_refcount++ > 0) return; /*already initialized*/
bctbx_mutex_init(&__bctbx_logger.domains_mutex, NULL);
- handler = bctbx_create_log_handler(bctbx_logv_out, bctbx_logv_out_destroy, NULL);
- bctbx_add_log_handler(handler);
+ if(create) {
- BctoolboxLogHandler* handler = bctbx_create_log_handler(bctbx_logv_out, bctbx_logv_out_destroy, NULL);
++ bctbx_log_handler_t* handler = bctbx_create_log_handler(bctbx_logv_out, bctbx_logv_out_destroy, NULL);
+ bctbx_add_log_handler(handler);
+ }
}
void bctbx_log_handlers_free(void) {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-voip/bctoolbox.git
More information about the Pkg-voip-commits
mailing list