src/dpdk/lib/librte_eal/common/eal_common_log.c
int
rte_log_set_level_regexp(const char *regex, uint32_t level)
{
	regex_t r;
	size_t i;

	if (level > RTE_LOG_DEBUG)
		return -1;

	if (regcomp(&r, regex, 0) != 0)
		return -1;

	for (i = 0; i < rte_logs.dynamic_types_len; i++) {
		if (rte_logs.dynamic_types[i].name == NULL)
			continue;
		if (regexec(&r, rte_logs.dynamic_types[i].name, 0,
				NULL, 0) == 0)
			rte_logs.dynamic_types[i].loglevel = level;
	}

	regfree(&r);

	return 0;
}
/* set log level by regular expression */
set log level by regular expression
set log level by regular expression
int
rte_log_set_level_regexp(const char *regex, uint32_t level)
{
	regex_t r;
	size_t i;
	if (level > RTE_LOG_DEBUG)
		return -1;
	if (regcomp(&r, regex, 0) != 0)
		return -1;
	for (i = 0; i < rte_logs.dynamic_types_len; i++) {
		if (rte_logs.dynamic_types[i].name == NULL)
			continue;
		if (regexec(&r, rte_logs.dynamic_types[i].name, 0,
				NULL, 0) == 0)
			rte_logs.dynamic_types[i].loglevel = level;
	}
	regfree(&r);
	return 0;
}
int rte_log_set_level_regexp ( const char * regex , uint32_t level ) { regex_t r ; size_t i ; if ( level > RTE_LOG_DEBUG ) return -1 ; if ( regcomp ( & r , regex , 0 ) != 0 ) return -1 ; for ( i = 0 ; i < rte_logs . dynamic_types_len ; i ++ ) { if ( rte_logs . dynamic_types [ i ] . name == NULL ) continue ; if ( regexec ( & r , rte_logs . dynamic_types [ i ] . name , 0 , NULL , 0 ) == 0 ) rte_logs . dynamic_types [ i ] . loglevel = level ; } regfree ( & r ) ; return 0 ; }
set log level by regular expression
set log level by regular expression