refact(ll-box): let loglevel effect syslog

Signed-off-by: black-desk <me@black-desk.cn>
This commit is contained in:
black-desk 2024-04-18 15:33:47 +08:00
parent 8a36030481
commit d223aea48c
1 changed files with 5 additions and 3 deletions

View File

@ -43,6 +43,10 @@ public:
~Logger()
{
if (level < LOGLEVEL) {
return;
}
std::string prefix;
auto pid_ns = GetPidnsPid();
int syslogLevel = LOG_DEBUG;
@ -64,9 +68,7 @@ public:
break;
}
syslog(syslogLevel, "%s|%s:%d %s", pid_ns.c_str(), function, line, ss.str().c_str());
if (level < LOGLEVEL) {
return;
}
switch (level) {
case Debug:
prefix = "[DBG |";