-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.cpp
executable file
·47 lines (40 loc) · 1.52 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include "LogManager.h"
#include "StdOutLogger.h"
#include "FileLogger.h"
#include "SyslogLogger.h"
int main(void)
{
//BaseLogger *p = new StdOutLogger();
//p->LogInfo("Info", __FILE__, __LINE__, __FUNCTION__);
//p->LogWarn("Warn", __FILE__, __LINE__, __FUNCTION__);
//p->LogError("Error", __FILE__, __LINE__, __FUNCTION__);
//p->LogDebug("Debug", __FILE__, __LINE__, __FUNCTION__);
//delete p;
//p = new FileLogger();
//p->LogInfo("Info", __FILE__, __LINE__, __FUNCTION__);
//p->LogWarn("Warn", __FILE__, __LINE__, __FUNCTION__);
//p->LogError("Error", __FILE__, __LINE__, __FUNCTION__);
//p->LogDebug("Debug", __FILE__, __LINE__, __FUNCTION__);
//delete p;
//LogManager *manager = LogManager::GetInstance();
//manager->SetLogLevel(E_LOG_LEVEL::LOG_LEVEL_NOTSET);
//manager->AppendLoger(new StdOutLogger());
//manager->LogInfo("Hello Info", __FILE__, __LINE__, __FUNCTION__);
//manager->LogWarn("Hello Warn", __FILE__, __LINE__, __FUNCTION__);
//manager->LogError("Hello Error", __FILE__, __LINE__, __FUNCTION__);
//manager->FreeInstance();
LOG_INSTANCE->AppendLoger(new FileLogger());
//LOG_INSTANCE->SetLogLevel(E_LOG_LEVEL::LOG_LEVEL_WARN);
SyslogLogger *sysLog = new SyslogLogger();
//sysLog->SetFacilityCode(LOG_USER);
LOG_INSTANCE->AppendLoger(sysLog);
INFO("Hello Info");
WARN("Hello Warn");
ERROR("Hello Error");
LOG_FREE();
INFO("Hello Info");
WARN("Hello Warn");
ERROR("Hello Error");
getchar();
return 0;
}