Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
The container registry cleanup task is now completed and the registry can be used normally.
Open sidebar
dcdb
dcdb
Commits
4769586b
Commit
4769586b
authored
Mar 02, 2018
by
Micha Mueller
Browse files
Add logger as member variable to Sensor and Configurator base class
parent
76ec9e7d
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Configurator.h
View file @
4769586b
...
...
@@ -8,11 +8,11 @@
#ifndef SRC_CONFIGURATOR_H_
#define SRC_CONFIGURATOR_H_
#include
"Sensor.h"
#include
<vector>
#include
<string>
class
Sensor
;
/**
* Abstract base class, which defines the interface for the configurators in the shared dynamic libraries.
*/
...
...
@@ -34,6 +34,7 @@ public:
protected:
std
::
string
_mqttPrefix
;
boost
::
log
::
sources
::
severity_logger
<
boost
::
log
::
trivial
::
severity_level
>
lg
;
};
//typedef for more readable usage of create()- and destroy()-methods, required for dynamic libraries
...
...
src/Sensor.h
View file @
4769586b
...
...
@@ -12,6 +12,15 @@
#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)
typedef
struct
{
uint64_t
value
;
uint64_t
timestamp
;
...
...
@@ -58,6 +67,7 @@ protected:
reading_t
_latestValue
;
boost
::
asio
::
deadline_timer
*
_timer
;
boost
::
lockfree
::
spsc_queue
<
reading_t
>*
_readingQueue
;
boost
::
log
::
sources
::
severity_logger
<
boost
::
log
::
trivial
::
severity_level
>
lg
;
};
#endif
/* SENSOR_H_ */
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment