mirror of
https://github.com/scorpion-26/gBar.git
synced 2024-11-22 11:12:49 +00:00
1241d7c87c
Implements a rough outline of the SNI (StatusNotifierItem) d-bus protocol for tray icons. Note: This is currently *very* WIP Full implementation will close https://github.com/scorpion-26/gBar/issues/5
29 lines
735 B
C++
29 lines
735 B
C++
#pragma once
|
|
#include <sstream>
|
|
#include <iostream>
|
|
|
|
#ifdef USE_LOGFILE
|
|
#define LOG(x) \
|
|
std::cout << x << '\n'; \
|
|
{ \
|
|
std::stringstream str; \
|
|
str << x; \
|
|
Logging::Log(str.str()); \
|
|
}
|
|
#else
|
|
#define LOG(x) std::cout << x << '\n'
|
|
#endif
|
|
#define ASSERT(x, log) \
|
|
if (!(x)) \
|
|
{ \
|
|
LOG(log << "\n[Exiting due to assert failed]"); \
|
|
exit(-1); \
|
|
}
|
|
namespace Logging
|
|
{
|
|
void Init();
|
|
|
|
void Log(const std::string& str);
|
|
|
|
void Shutdown();
|
|
}
|