|
10 | 10 | * [x] 支持输出到文件、控制台、调试器
|
11 | 11 | * [x] 支持格式化打印
|
12 | 12 |
|
13 | | -## 示例 |
14 | | - |
15 | | -```cpp |
16 | | -#include "log4cplusplus.h" |
17 | | - |
18 | | -int main(int argc, char *argv[]) |
19 | | -{ |
20 | | - log4cplus::Log4CPlusPlus* log = CreateLog4CPlusPlus(); |
21 | | - if (log) |
22 | | - { |
23 | | - log->AddFileAppender(); |
24 | | - log->EnableDebuggerAppender(true); |
25 | | - log->EnableConsoleAppender(true); |
26 | | - |
27 | | - LOG4CPLUSPLUS_DEBUG(log, L"log test"); |
28 | | - LOG4CPLUSPLUS_INFO(log, L"log test %s", L"info"); |
29 | | - LOG4CPLUSPLUS_WARN(log, L"log test %s %d", L"warn", 123); |
30 | | - LOG4CPLUSPLUS_ERROR(log, L"log test %f", 3.14); |
31 | | - LOG4CPLUSPLUS_ERROR(log, L"中文日志测试!!"); |
32 | | - |
33 | | - log->Release(); |
34 | | - } |
35 | | - return 0; |
36 | | -} |
37 | | -``` |
| 13 | +## Clone |
| 14 | + |
| 15 | +``` |
| 16 | +git clone --recursive https://github.com/huihut/log4cplusplus.git |
| 17 | +``` |
| 18 | + |
| 19 | +## Build |
| 20 | + |
| 21 | +``` |
| 22 | +./generate_sln.bat |
| 23 | +``` |
| 24 | + |
| 25 | +## Usage |
| 26 | + |
| 27 | +[tests/logtest/main.cc](tests/logtest/main.cc) |
0 commit comments