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:
@ -125,13 +125,8 @@ int main(int argc, char **argv) {
|
||||
num_args = optind;
|
||||
|
||||
mxs_log_init(NULL, NULL, LOG_TARGET_DEFAULT);
|
||||
|
||||
mxs_log_set_augmentation(0);
|
||||
|
||||
if (!debug_out)
|
||||
skygw_log_disable(LOGFILE_DEBUG);
|
||||
else
|
||||
skygw_log_enable(LOGFILE_DEBUG);
|
||||
mxs_log_set_priority_enabled(LOG_DEBUG, debug_out);
|
||||
|
||||
if ((inst = calloc(1, sizeof(ROUTER_INSTANCE))) == NULL) {
|
||||
LOGIF(LE, (skygw_log_write_flush(LOGFILE_ERROR,
|
||||
|
@ -91,10 +91,10 @@ int main(int argc, char **argv) {
|
||||
|
||||
mxs_log_init(NULL, NULL, LOG_TARGET_DEFAULT);
|
||||
|
||||
skygw_log_disable(LOGFILE_DEBUG);
|
||||
skygw_log_disable(LOGFILE_TRACE);
|
||||
skygw_log_disable(LOGFILE_ERROR);
|
||||
skygw_log_disable(LOGFILE_MESSAGE);
|
||||
mxs_log_set_priority_enabled(LOG_DEBUG, false);
|
||||
mxs_log_set_priority_enabled(LOG_INFO, false);
|
||||
mxs_log_set_priority_enabled(LOG_NOTICE, false);
|
||||
mxs_log_set_priority_enabled(LOG_ERR, false);
|
||||
|
||||
service = service_alloc("test_service", "binlogrouter");
|
||||
service->credentials.name = strdup("foo");
|
||||
|
Reference in New Issue
Block a user