Skip to content

Commit

Permalink
Only register with DLT if DLT logging is enabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
ralight committed Aug 16, 2023
1 parent 67ac8cb commit 3fc7dce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 6 additions & 4 deletions src/logging.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,12 @@ int log__init(struct mosquitto__config *config)
setlinebuf(stdout);
}
#ifdef WITH_DLT
dlt_fifo_check();
if(dlt_allowed){
DLT_REGISTER_APP("MQTT","mosquitto log");
dlt_register_context(&dltContext, "MQTT", "mosquitto DLT context");
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;
Expand Down

0 comments on commit 3fc7dce

Please sign in to comment.