TarsCloud / TarsCpp

C++ language framework rpc source code implementation
BSD 3-Clause "New" or "Revised" License
522 stars 254 forks source link

【tarslog】想问下按一定频率记日志怎么实现的? #253

Closed libo1712 closed 2 years ago

libo1712 commented 2 years ago

RemoteLogger.h中有这样一段 /**

ruanshudong commented 2 years ago

你代码怎么写? 贴出来看看

libo1712 commented 2 years ago

比如想两分钟记次日志,我按照RemoteLogger.h中的定义在初始化完这样写的: RemoteTimeLogger::getInstance()->initFormatWithType("","%Y%m%d%H%M", 2);

编译会报错,能给个简单的demo么,谢谢大神

libo1712 commented 2 years ago

我没看到模板类,这样写就对了 RemoteTimeLogger::getInstance()->initFormatWithType("","%Y%m%d%H%M", 2); 建议把RemoteLogger.h中的注释稍微改下