simple_log 一个轻量的c++日志组件

 

特点

  • 简洁但是功能实用
  • 只支持linux
  • 线程不安全

功能列表

  • 支持动态加载配置文件,修改日志等级
  • 支持使用脚本进行日志文件的切分

性能

  • 10万/s 日志写入

构建 && 测试

  make && make test

配置文件(可选)

  • 默认会找conf/simple_log.conf,如果没有找到,会将日志以debug级别输出到控制台
  • 如果配置了log_file,需要保证log目录已经存在
 log_level=INFO
 log_file=log/simple.log

例子:

#include "simple_log.h"

int main() {
  // init_log_config("conf/simple_log.conf"); 
  LOG_INFO("%s", "this is a info log");
  return 0;
}

编译

 g++ -I bin/include test/simple_log_test.cpp bin/lib/libsimplelog.a -o bin/simple_log_test

输出

 2014-10-25 15:43:29.216 INFO test/simple_log_test.cpp(5): this is a info log

 

 项目地址https://github.com/hongliuliao/simple_log

 

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值