-
Notifications
You must be signed in to change notification settings - Fork 952
acl 的日志回调能否提供日志等级信息 #369
Copy link
Copy link
Open
Description
我们想将 acl 底层库的日志打印集成到上层业务服务的日志系统中,看到有个回调设计,就这么用了:
void LogHookForACL(void* ctx, const char* fmt, va_list ap)
{
static char szbuffer[1024] = {0};
vsnprintf(szbuffer, sizeof(szbuffer), fmt, ap);
// acl redis 库基本只在出错时打印 logger_error
LOG_ERROR(szbuffer);
}
void InitLogHookForACL()
{
acl_msg_pre_write(LogHookForACL, nullptr);
}这有个不足是回调中似乎没有提供日志等级信息,上层只能统一打印为 ERROR 级别的日志。
我看到 acl 源码中也有几种不同的写日志函数(宏),说明也是有日志等级概念的,那能否把这个日志等级信息传出来,让上层日志系统也能通过等级来控制。
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels