Only register with DLT if DLT logging is enabled.

This commit is contained in:
Roger A. Light 2023-06-09 00:37:42 +01:00
parent 67ac8cbe17
commit 3fc7dce74c
2 changed files with 7 additions and 4 deletions

View File

@ -20,6 +20,7 @@ Broker:
if the owner/group is not the same as the user/group the broker is running
as. In future versions the broker will refuse to open these files.
- mosquitto_memcmp_const is now more constant time.
- Only register with DLT if DLT logging is enabled.
Client library:
- Use CLOCK_BOOTTIME when available, to keep track of time. This solves the

View File

@ -134,11 +134,13 @@ int log__init(struct mosquitto__config *config)
setlinebuf(stdout);
}
#ifdef WITH_DLT
if(log_destinations & MQTT3_LOG_DLT){
dlt_fifo_check();
if(dlt_allowed){
DLT_REGISTER_APP("MQTT","mosquitto log");
dlt_register_context(&dltContext, "MQTT", "mosquitto DLT context");
}
}
#endif
return rc;
}