2015-07-31 22:41:26 -07:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* Copyright (c) FIRST 2015. 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 NT_LOG_H_
|
|
|
|
|
#define NT_LOG_H_
|
|
|
|
|
|
2016-07-27 00:39:38 -07:00
|
|
|
#include "support/atomic_static.h"
|
|
|
|
|
#include "support/Logger.h"
|
2015-07-31 22:41:26 -07:00
|
|
|
|
|
|
|
|
namespace nt {
|
|
|
|
|
|
2016-07-27 00:39:38 -07:00
|
|
|
class Logger : public wpi::Logger {
|
2015-07-31 22:41:26 -07:00
|
|
|
public:
|
|
|
|
|
static Logger& GetInstance() {
|
|
|
|
|
ATOMIC_STATIC(Logger, instance);
|
|
|
|
|
return instance;
|
|
|
|
|
}
|
|
|
|
|
~Logger();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
Logger();
|
|
|
|
|
|
|
|
|
|
ATOMIC_STATIC_DECL(Logger)
|
|
|
|
|
};
|
|
|
|
|
|
2016-07-27 00:39:38 -07:00
|
|
|
#define LOG(level, x) WPI_LOG(nt::Logger::GetInstance(), level, x)
|
2015-07-31 22:41:26 -07:00
|
|
|
|
2015-08-03 01:23:42 -07:00
|
|
|
#undef ERROR
|
2016-07-27 00:39:38 -07:00
|
|
|
#define ERROR(x) WPI_ERROR(nt::Logger::GetInstance(), x)
|
|
|
|
|
#define WARNING(x) WPI_WARNING(nt::Logger::GetInstance(), x)
|
|
|
|
|
#define INFO(x) WPI_INFO(nt::Logger::GetInstance(), x)
|
|
|
|
|
|
|
|
|
|
#define DEBUG(x) WPI_DEBUG(nt::Logger::GetInstance(), x)
|
|
|
|
|
#define DEBUG1(x) WPI_DEBUG1(nt::Logger::GetInstance(), x)
|
|
|
|
|
#define DEBUG2(x) WPI_DEBUG2(nt::Logger::GetInstance(), x)
|
|
|
|
|
#define DEBUG3(x) WPI_DEBUG3(nt::Logger::GetInstance(), x)
|
|
|
|
|
#define DEBUG4(x) WPI_DEBUG4(nt::Logger::GetInstance(), x)
|
2015-07-31 22:41:26 -07:00
|
|
|
|
2016-11-03 21:03:45 -07:00
|
|
|
} // namespace nt
|
2015-07-31 22:41:26 -07:00
|
|
|
|
|
|
|
|
#endif // NT_LOG_H_
|