mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
Switches to the new build system (#87)
* Removes old build system * Removes old gmock * Adds new gmock * Moves source files to new locations * Adds new build system
This commit is contained in:
committed by
Peter Johnson
parent
9d45088127
commit
133540f577
57
src/main/native/cpp/Log.h
Normal file
57
src/main/native/cpp/Log.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) FIRST 2016. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef CS_LOG_H_
|
||||
#define CS_LOG_H_
|
||||
|
||||
#include "support/atomic_static.h"
|
||||
#include "support/Logger.h"
|
||||
|
||||
namespace cs {
|
||||
|
||||
class Logger : public wpi::Logger {
|
||||
public:
|
||||
static Logger& GetInstance() {
|
||||
ATOMIC_STATIC(Logger, instance);
|
||||
return instance;
|
||||
}
|
||||
~Logger();
|
||||
|
||||
void SetDefaultLogger();
|
||||
|
||||
private:
|
||||
Logger();
|
||||
|
||||
ATOMIC_STATIC_DECL(Logger)
|
||||
};
|
||||
|
||||
#define LOG(level, x) WPI_LOG(cs::Logger::GetInstance(), level, x)
|
||||
|
||||
#undef ERROR
|
||||
#define ERROR(x) WPI_ERROR(cs::Logger::GetInstance(), x)
|
||||
#define WARNING(x) WPI_WARNING(cs::Logger::GetInstance(), x)
|
||||
#define INFO(x) WPI_INFO(cs::Logger::GetInstance(), x)
|
||||
|
||||
#define DEBUG(x) WPI_DEBUG(cs::Logger::GetInstance(), x)
|
||||
#define DEBUG1(x) WPI_DEBUG1(cs::Logger::GetInstance(), x)
|
||||
#define DEBUG2(x) WPI_DEBUG2(cs::Logger::GetInstance(), x)
|
||||
#define DEBUG3(x) WPI_DEBUG3(cs::Logger::GetInstance(), x)
|
||||
#define DEBUG4(x) WPI_DEBUG4(cs::Logger::GetInstance(), x)
|
||||
|
||||
#define SERROR(x) ERROR(GetName() << ": " << x)
|
||||
#define SWARNING(x) WARNING(GetName() << ": " << x)
|
||||
#define SINFO(x) INFO(GetName() << ": " << x)
|
||||
|
||||
#define SDEBUG(x) DEBUG(GetName() << ": " << x)
|
||||
#define SDEBUG1(x) DEBUG1(GetName() << ": " << x)
|
||||
#define SDEBUG2(x) DEBUG2(GetName() << ": " << x)
|
||||
#define SDEBUG3(x) DEBUG3(GetName() << ": " << x)
|
||||
#define SDEBUG4(x) DEBUG4(GetName() << ": " << x)
|
||||
|
||||
} // namespace cs
|
||||
|
||||
#endif // CS_LOG_H_
|
||||
Reference in New Issue
Block a user