secgateway/Platform/user/ulog/log-sched/log_console.c

32 lines
960 B
C
Raw Normal View History

#include "log_console.h"
#include "log_common.h"
#define LOG_CONF_COSOLE_FILE_NAME "log-console.conf"
#define LOG_REDIRECT_CONSOLE "/dev/console"
static int config_log_console(const log_console_t *conf)
{
if (write_log_conf_authorizing(conf->level, LOG_CONF_PATH,
LOG_CONF_COSOLE_FILE_NAME, LOG_REDIRECT_CONSOLE, conf->module_name) != 0) {
ULOG_ERR(g_log, "Writing console[module:%s] of log is failure", conf->module_name);
return 1;
}
return 0;
}
void rpc_conf_log_console(rpc_conn *conn, pointer input, int input_len, pointer data)
{
u32 need_len = sizeof(log_console_t);
if (input_len < need_len) {
ULOG_WARNING(g_log,
"The input paramter of rpc log console is needed length of %u, but the actual length is %u",
need_len, input_len);
return;
}
config_log_console((const log_console_t *)input);
}