log: add wp_logt_checked taking WpLogTopic, to decide on debug messages

Make decision on whether to show code location in journal messages based
on whether the WpLogTopic would enable DEBUG level messages.

Add wp_logt_checked API to take WpLogTopic as input to make this
possible, and deprecate wp_log_checked.
This commit is contained in:
Pauli Virtanen
2024-04-28 15:59:56 +03:00
committed by George Kiagiadakis
parent 8016ad1cec
commit 2fb055f43d
3 changed files with 49 additions and 2 deletions

View File

@@ -384,7 +384,7 @@ log_log (lua_State *L, GLogLevelFlags lvl)
snprintf (line_str, 11, "%d", ar.currentline);
ar.name = ar.name ? ar.name : "chunk";
wp_log_checked (topic->topic_name, lvl,
wp_logt_checked (topic, lvl,
ar.source, line_str, ar.name, type, instance, "%s", message);
return 0;
}