Log: Another step in the move from logfiles to priorities.

skygw_[enable|disable]_log has now been removed from the external
interface and priorities must instead be set using
mxs_log_set_priority_enabled(int priority, bool enabled). A bitmask
is already being updated, but internally and as used by the LOG_IF
macros, the actual enabling is still made using logfile ids.

The configuration entries have been replaced as follows:

	log_messages -> log_notice
	log_trace    -> log_info

The old ones can be used, but cause a warning to be logged.

Similarily the maxadmin commands have been updated.
"[enable|disable] log ..." works as expected, but there will be
a message about it being deprecated. Instead there is now a
[enable|disable] log-priority err|warning|notice|info|debug
command that should be used instead.
This commit is contained in:
Johan Wikman
2015-11-13 13:47:10 +02:00
parent 2dcdab29b6
commit bcb918e60b
8 changed files with 238 additions and 238 deletions

View File

@ -23,6 +23,38 @@
#include <skygw_utils.h>
#include <log_manager.h>
static logfile_id_t id_to_priority(logfile_id_t id)
{
switch (id)
{
case LOGFILE_ERROR:
return LOG_ERR;
case LOGFILE_MESSAGE:
return LOG_NOTICE;
case LOGFILE_TRACE:
return LOG_INFO;
case LOGFILE_DEBUG:
return LOG_DEBUG;
default:
assert(!true);
return LOG_ERR;
}
}
static void skygw_log_enable(logfile_id_t id)
{
mxs_log_set_priority_enabled(id_to_priority(id), true);
}
static void skygw_log_disable(logfile_id_t id)
{
mxs_log_set_priority_enabled(id_to_priority(id), false);
}
int main(int argc, char** argv)
{
int iterations = 0, i, interval = 10;