gBar/src/Log.h
scorpion-26 1241d7c87c SNI: Initial proof of concept
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
2023-05-04 13:57:50 +02:00

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();
}