summaryrefslogtreecommitdiff
path: root/src/lib/dlt_user.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/dlt_user.c')
-rw-r--r--src/lib/dlt_user.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lib/dlt_user.c b/src/lib/dlt_user.c
index 3d1c18c..2f54023 100644
--- a/src/lib/dlt_user.c
+++ b/src/lib/dlt_user.c
@@ -144,6 +144,10 @@ pthread_mutex_t mq_mutex = PTHREAD_MUTEX_INITIALIZER;
pthread_cond_t mq_init_condition;
#endif /* DLT_NETWORK_TRACE_ENABLE */
+/* use these variables from common.c*/
+extern int logging_mode;
+extern FILE *logging_handle;
+
void dlt_lock_mutex(pthread_mutex_t *mutex)
{
int32_t lock_mutex_result = pthread_mutex_lock(mutex);
@@ -454,6 +458,12 @@ DltReturnValue dlt_init(void)
/* check environment variables */
dlt_check_envvar();
+ /* Check logging mode and internal log file is opened or not*/
+ if(logging_mode == DLT_LOG_TO_FILE && logging_handle == NULL)
+ {
+ dlt_log_init(logging_mode);
+ }
+
/* process is exiting. Do not allocate new resources. */
if (dlt_user_freeing != 0) {
dlt_vlog(LOG_INFO, "%s logging disabled, process is exiting", __func__);