From: Philippe Proulx Date: Sat, 20 May 2017 00:49:41 +0000 (-0400) Subject: Library: log version (INFO) on construction X-Git-Tag: v2.0.0-pre1~211 X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;h=1e0aa71d6620ed43b99b5b379c1183dda63f3761;p=babeltrace.git Library: log version (INFO) on construction Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- diff --git a/lib/logging.c b/lib/logging.c index 4272677d..53c2a846 100644 --- a/lib/logging.c +++ b/lib/logging.c @@ -22,6 +22,9 @@ #include #include +#include + +#define BT_LOG_TAG "LIB" #include BT_HIDDEN @@ -47,6 +50,8 @@ void __attribute__((constructor)) bt_logging_ctor(void) { enum bt_logging_level log_level = BT_LOG_NONE; const char *log_level_env = getenv("BABELTRACE_LOGGING_GLOBAL_LEVEL"); + const char *v_extra = bt_version_get_extra() ? bt_version_get_extra() : + ""; if (!log_level_env) { goto set_level; @@ -68,4 +73,10 @@ void __attribute__((constructor)) bt_logging_ctor(void) set_level: bt_logging_set_global_level(log_level); + BT_LOGI("Babeltrace %d.%d.%d%s library loaded: " + "major=%d, minor=%d, patch=%d, extra=\"%s\"", + bt_version_get_major(), bt_version_get_minor(), + bt_version_get_patch(), v_extra, + bt_version_get_major(), bt_version_get_minor(), + bt_version_get_patch(), v_extra); }