POCO开源库的日志使用示例
来源:互联网 发布:大数据培训ujiuye 编辑:程序博客网 时间:2024/06/06 01:32
#include "Poco/Logger.h"#include "Poco/FormattingChannel.h"#include "Poco/PatternFormatter.h"#include "Poco/FileChannel.h"#include "Poco/Message.h"using Poco::Logger;using Poco::PatternFormatter;using Poco::FormattingChannel;using Poco::FileChannel;using Poco::Message;#pragma comment(lib,"PocoFoundationd.lib")int main(){FormattingChannel *pFCFile = NULL;pFCFile = new FormattingChannel(new PatternFormatter("%Y-%m-%d %H:%M:%S.%c %U %u %N[%P]:%s:%q:%t"));pFCFile->setChannel(new FileChannel("./sample.log"));pFCFile->open();Logger &fileLogger = Logger::create("FileLogger", pFCFile, Message::PRIO_DEBUG);fileLogger.debug("an debug msg!", "main.cpp", 24);//24表示行号fileLogger.information("an info msg!");fileLogger.error("an error msg!");fileLogger.fatal("an fatal msg!");pFCFile->close();return 0;}
0 0
- POCO开源库的日志使用示例
- POCO日志库使用示例
- POCO: 日志的使用
- Poco::日志的配置文件属性
- POCO库的使用
- poco JSON 的使用
- 使用Poco::Logger实现日志功能
- Poco C++ 日志框架使用 Pcoco Logger
- Poco logger 日志使用小析
- Poco C++ 简单的日志封装
- Poco使用SQLite的事务
- POCO日志框架
- Poco 日志 之 系统日志
- Poco中插件的使用范例
- Poco c++ Library 之xml 的使用
- POCO C++ 在IOS上的使用
- poco中的进程使用的纠结
- poco for ARM的安装及使用
- 微信公众平台接口程序定制菜单
- maven源码转化为eclipse打开的项目
- Python高级特性(2):Closures、Decorators和functools
- HDU 1114 Piggy-Bank
- 如何得到下载文件的文件名
- POCO开源库的日志使用示例
- 《Android学习指南》目录
- Binary Search
- 实现一个视图在固定圆圈内移动
- html框架及锚点
- Collections:给集合操作提供了更多的功能和Arraylist使用方法
- 详细的AWR解析报告
- JS面向对象编程---对象
- hadoop配置lzo,外加自己遇到错误的解决方法