log4cpp 封装

本文记录了作者学习log4cpp的日志库,并进行了封装的过程,方便日后查阅。
摘要由CSDN通过智能技术生成

最近学习log4cpp,试着封装了下,mark下。

#include<iostream>
#include<log4cpp/Category.hh>

#include<log4cpp/Appender.hh>
#include<log4cpp/FileAppender.hh>
#include<log4cpp/RollingFileAppender.hh>
#include<log4cpp/OstreamAppender.hh>

#include<log4cpp/PatternLayout.hh>
#include<log4cpp/Priority.hh>

using namespace std;

//1.实现日志文件信息在终端上显示
//2.实现日志文件信息在终端和日志文件同时显示
//3.实现回滚备份,替换掉2即可
class Mylog
{
    public:
        Mylog();
        ~Mylog();
    public:
        void error(const char * msg);
        void warn(const char * msg);
        void info(const char * msg);
        void debug(const 
  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值