Browse Source

pEpLog - includes in headers are to be avoided if possible

pull/8/head
heck 1 year ago
parent
commit
2b41a6717e
2 changed files with 12 additions and 11 deletions
  1. +5
    -1
      src/pEpLog.cc
  2. +7
    -10
      src/pEpLog.hh

+ 5
- 1
src/pEpLog.cc View File

@ -7,6 +7,10 @@
#include <mutex>
#include <atomic>
#ifdef ANDROID
#include <android/log.h>
#endif
namespace pEp {
namespace Adapter {
@ -14,7 +18,7 @@ namespace pEp {
std::mutex mtx;
std::atomic_bool is_enabled{false};
std::atomic_bool is_enabled{ false };
void set_enabled(bool enabled)
{


+ 7
- 10
src/pEpLog.hh View File

@ -6,10 +6,6 @@
#include <sstream>
#include <thread>
#ifdef ANDROID
#include <android/log.h>
#endif
// pEpLog
// ======
// a "to be kept ultra small and simple" logging unit.
@ -36,12 +32,13 @@
do { \
} while (0)
#else
#define pEpLog(msg) \
do { \
std::stringstream msg_ss; \
msg_ss << std::this_thread::get_id() << " - " << __FILE__ << "::" << __FUNCTION__ << " - " << msg; \
pEp::Adapter::pEpLog::log(msg_ss.str()); \
} while(0)
#define pEpLog(msg) \
do { \
std::stringstream msg_ss; \
msg_ss << std::this_thread::get_id() << " - " << __FILE__ << "::" << __FUNCTION__ \
<< " - " << msg; \
pEp::Adapter::pEpLog::log(msg_ss.str()); \
} while (0)
#endif // NDEBUG
namespace pEp {


Loading…
Cancel
Save