Git Product home page Git Product logo

qt-logs-logger's Introduction

Logs

这是一个写日志文件的工具类,采用单例模式,内部通过加锁实现线程安全

功能概述:

该类自动以当前日期作为日志文件名,格式形如“yyyy-MM-dd.log”,统一保存在指定的logsDir下。为了避免随着时间增长日志文件越来越多,可以在每次程序启动时调用rmLogsFile(int retainDays),只保留最近几天的日志而删去其他无用的日志。

/*接口函数*/
void setLogsDir(const QString &dirPath);//设置日志文件目录
void rmLogsFile(int retainDays=0);//删除日志文件
void writeLogs(const QString &content,LogsLevel logsLevel=INFO_LEVEL);//写日志

作者联系方式:

邮箱:[email protected]
新浪微博:@为-何-而来

qt-logs-logger's People

Contributors

justdoit-mqr 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.