forked from ryanpeach/openscan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogging.hpp
28 lines (23 loc) · 1.22 KB
/
logging.hpp
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
//Code coppied from http://muecpp.blogspot.com/2007/12/usefull-log4cpp-example_27.html
#include "stdio.h"
#include "iostream"
#include "log4cpp/Category.hh"
#include "log4cpp/Appender.hh"
#include "log4cpp/OstreamAppender.hh"
#include "log4cpp/FileAppender.hh"
#include "log4cpp/Layout.hh"
#include "log4cpp/BasicLayout.hh"
#include "log4cpp/Priority.hh"
#include "log4cpp/NDC.hh"
#include "log4cpp/PropertyConfigurator.hh"
#define CODE_LOCATION __FILE__
#define TEST
// DEBUG < INFO < NOTICE < WARN < ERROR < CRIT < ALERT < FATAL = EMERG
#define LOG_EMERG(__logstream) __logstream << log4cpp::Priority::EMERG << CODE_LOCATION
#define LOG_ALERT(__logstream) __logstream << log4cpp::Priority::ALERT << CODE_LOCATION
#define LOG_CRIT(__logstream) __logstream << log4cpp::Priority::CRIT << CODE_LOCATION
#define LOG_ERROR(__logstream) __logstream << log4cpp::Priority::ERROR << CODE_LOCATION
#define LOG_WARN(__logstream) __logstream << log4cpp::Priority::WARN << CODE_LOCATION
#define LOG_NOTICE(__logstream) __logstream << log4cpp::Priority::NOTICE << CODE_LOCATION
#define LOG_INFO(__logstream) __logstream << log4cpp::Priority::INFO << CODE_LOCATION
#define LOG_DEBUG(__logstream) __logstream << log4cpp::Priority::DEBUG << CODE_LOCATION