Use magic statics instead of ATOMIC_STATIC. (#109)

This commit is contained in:
Peter Johnson
2017-11-17 09:29:20 -08:00
committed by GitHub
parent 20c8d29ae9
commit 3324bcc5ce
10 changed files with 6 additions and 42 deletions

View File

@@ -9,14 +9,13 @@
#define CSCORE_LOG_H_
#include <support/Logger.h>
#include <support/atomic_static.h>
namespace cs {
class Logger : public wpi::Logger {
public:
static Logger& GetInstance() {
ATOMIC_STATIC(Logger, instance);
static Logger instance;
return instance;
}
~Logger();
@@ -25,8 +24,6 @@ class Logger : public wpi::Logger {
private:
Logger();
ATOMIC_STATIC_DECL(Logger)
};
#define LOG(level, x) WPI_LOG(cs::Logger::GetInstance(), level, x)