Commit 68d1f169 authored by Micha Mueller's avatar Micha Mueller
Browse files

Introduce new file Logging.h which bundles all stuff required for logging

parent 4f454ff4
/*
* Logging.h
*
* Created on: 05.05.2018
* Author: Micha Mueller
*/
#ifndef LOGGING_H_
#define LOGGING_H_
/*
* Simple header file to bundle all includes required for logging with boost::log.
* Simplifies logging: one has to include only this single header file which additionally
* offers shortcut macros for convenient logging.
* However, most of the classes already include Sensor.h which in turn includes Logging.h
*/
#include <boost/log/trivial.hpp>
#include <boost/log/sources/severity_logger.hpp>
//further abbreviate the boost shortcut-macro
//to use it, only a boost severity-logger named lg is required
#define LOG(sev) BOOST_LOG_SEV(lg, boost::log::trivial::sev)
#endif /* LOGGING_H_ */
......@@ -12,14 +12,7 @@
#include <boost/asio.hpp>
#include <boost/lockfree/spsc_queue.hpp>
//TODO includes and defines for logging are only here once because Sensor.h is somehow involved everywhere
// but is this the best possiblility?
#include <boost/log/trivial.hpp>
#include <boost/log/sources/severity_logger.hpp>
//abbreviate the shortcut-macro
//to use it only a boost severity-logger named lg is required
#define LOG(sev) BOOST_LOG_SEV(lg, boost::log::trivial::sev)
#include "Logging.h"
typedef struct {
uint64_t value;
......
......@@ -7,7 +7,6 @@
#include "BACnetClient.h"
//#include "client.h"
#include "bacnetTEMP/address.h"
#include "bacnetTEMP/apdu.h"
#include "bacnetTEMP/bacapp.h"
......
......@@ -8,7 +8,7 @@
#ifndef BACNETCLIENT_H_
#define BACNETCLIENT_H_
#include "../../Sensor.h" //only for logging
#include "../../Logging.h"
//TODO where to put bacnet?
#include "bacnetTEMP/apdu.h"
......
......@@ -8,11 +8,12 @@
#ifndef IPMIHOST_H_
#define IPMIHOST_H_
#include "../../Sensor.h" //only for logging
#include "../../Logging.h"
#include <string>
#include <list>
#include <freeipmi/freeipmi.h>
#include <boost/asio.hpp>
namespace DCDB {
......
......@@ -8,7 +8,7 @@
#ifndef PDUUNIT_H_
#define PDUUNIT_H_
#include "../../Sensor.h" //only for logging
#include "../../Logging.h"
#include <tuple>
#include <vector>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment