Giter Site home page Giter Site logo

logrecord's Introduction

c语言写的 日志库

简要:

这是用c语言写的 日志库,兼容 windowslinux,以前一直它记入日志,现在将它开源,欢迎大家给出意见。

说明

程序的接口为 LR_LOG(const char *file, int line, int level, int status, const char *fmt, ...)函数,调用此函数,传入参数。

参数说明:
  1. const char *file : 文件名称
  2. int line: 行号
  3. `int level: 错误级别
    • 0 -- 没有日志
    • 1 -- debug级别
    • 2 -- info级别
    • 3 -- warning级别
    • 4 -- err级别
  4. int status: 错误码
  5. const char *fmt:可变参数(用于LOG信息)

用法

  1. windows先在c盘 建立lrlog目录,linux则在用户目录建立log文件夹;
  2. logrecord.hlogrecord.c添加至项目,引用头文件logrecord.h
    #include "logrecord.h"
    
  3. 调用 LR_LOG(参数)函数

测试

test.c为测试程序,结果如下图:

logRecord

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.