-
Notifications
You must be signed in to change notification settings - Fork 0
/
logplus.h
43 lines (34 loc) · 1.07 KB
/
logplus.h
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
#pragma once
#include <string>
#include "log4cplus/logger.h"
#include "log4cplus/fileappender.h"
#include "log4cplus/consoleappender.h"
#include "log4cplus/layout.h"
#include "log4cplus/configurator.h"
#include "log4cplus/loggingmacros.h"
#include "AutoLock.h"
using namespace log4cplus;
using namespace helpers;
#define DEFAULT_LOG_CONFIGFILE "log4cplus.cfg"
#define LOGPLUS_DEBUG(p) LOG4CPLUS_DEBUG(logplus::m_logger, p)
#define LOGPLUS_INFO(p) LOG4CPLUS_INFO(logplus::m_logger, p)
#define LOGPLUS_WARN(p) LOG4CPLUS_WARN(logplus::m_logger, p)
#define LOGPLUS_ERROR(p) LOG4CPLUS_ERROR(logplus::m_logger, p)
#define LOGPLUS_FATAL(p) LOG4CPLUS_FATAL(logplus::m_logger, p)
class logplus
{
public:
static logplus *getlogger(const std::string strconf);
static void releaselogger();
public:
static Logger m_logger;
private:
logplus(void);
~logplus(void);
logplus(const logplus &);
const logplus &operator =(const logplus &);
static logplus *m_instance;
static bool m_binit;
static std::string m_strConfig;
//static CMutex m_mutex;
};