GithubHelp home page GithubHelp logo

skyformat99 / simple-log Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hongliuliao/simple-log

0.0 1.0 0.0 36 KB

simple but practical log util

License: Apache License 2.0

Makefile 5.53% Shell 0.64% C++ 93.83%

simple-log's Introduction

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

特点

  • 简洁但是功能实用
  • 线程安全

功能列表

  • 支持动态加载配置文件,修改日志等级 (kill -USR1 )
  • Auto shift file log by daily
  • Auto delete old log file if you need

性能

  • 10万/s 日志写入

配置文件

  • 如果没有找到,会将日志以debug级别输出到控制台
 log_level=INFO
 log_dir=log
 log_file=simple.log
 retain_day=7

例子:

#include "simple_log.h"

int main() {
    int ret = log_init("conf", "simple_log.conf");
    if (ret != 0) {
    	printf("log_init error!\n");
        return 1;
    }
    LOG_INFO("%s", "this is a info log");
    return 0;
}

build && test

 make && make test && ./output/bin/simple_log_test

输出

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

simple-log's People

Contributors

hongliuliao avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.