Commit c389ef80 authored by Stratos Psomadakis's avatar Stratos Psomadakis

Re-add renew_logctx

parent 235d20b6
......@@ -65,6 +65,7 @@ EXPORT_SYMBOL(xseg_leave_dynport);
EXPORT_SYMBOL(xseg_portno_nonstatic);
EXPORT_SYMBOL(__xseg_errbuf);
EXPORT_SYMBOL(renew_logctx);
EXPORT_SYMBOL(init_logctx);
EXPORT_SYMBOL(__xseg_log2);
EXPORT_SYMBOL(xseg_printtrace);
......@@ -37,6 +37,7 @@ extern char __xseg_errbuf[4096];
enum log_level { E = 0, W = 1, I = 2, D = 3};
extern void (*renew_logctx)(enum log_level level);
extern void (*init_logctx)(char *peer_name, enum log_level level);
void __xseg_log2(enum log_level level, char *fmt, ...);
......
......@@ -114,6 +114,16 @@ static inline int get_syslog_level(enum log_level level) {
return syslog_level;
}
static void __renew_logctx(enum log_level level)
{
/* FIXME: LOG_UPTO portability */
setlogmask(LOG_UPTO(get_syslog_level(level)));
return;
}
void (*renew_logctx)(enum log_level level) = __renew_logctx;
static void __init_logctx(char *peer_name, enum log_level level)
{
openlog(peer_name, LOG_PID | LOG_CONS, LOG_LOCAL0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment