WPILibC++  unspecified
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
Log.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) FIRST 2015. All Rights Reserved. */
3 /* Open Source Software - may be modified and shared by FRC teams. The code */
4 /* must be accompanied by the FIRST BSD license file in the root directory of */
5 /* the project. */
6 /*----------------------------------------------------------------------------*/
7 
8 #ifndef NT_LOG_H_
9 #define NT_LOG_H_
10 
11 #include "support/atomic_static.h"
12 #include "support/Logger.h"
13 
14 namespace nt {
15 
16 class Logger : public wpi::Logger {
17  public:
18  static Logger& GetInstance() {
19  ATOMIC_STATIC(Logger, instance);
20  return instance;
21  }
22  ~Logger();
23 
24  private:
25  Logger();
26 
27  ATOMIC_STATIC_DECL(Logger)
28 };
29 
30 #define LOG(level, x) WPI_LOG(nt::Logger::GetInstance(), level, x)
31 
32 #undef ERROR
33 #define ERROR(x) WPI_ERROR(nt::Logger::GetInstance(), x)
34 #define WARNING(x) WPI_WARNING(nt::Logger::GetInstance(), x)
35 #define INFO(x) WPI_INFO(nt::Logger::GetInstance(), x)
36 
37 #define DEBUG(x) WPI_DEBUG(nt::Logger::GetInstance(), x)
38 #define DEBUG1(x) WPI_DEBUG1(nt::Logger::GetInstance(), x)
39 #define DEBUG2(x) WPI_DEBUG2(nt::Logger::GetInstance(), x)
40 #define DEBUG3(x) WPI_DEBUG3(nt::Logger::GetInstance(), x)
41 #define DEBUG4(x) WPI_DEBUG4(nt::Logger::GetInstance(), x)
42 
43 } // namespace nt
44 
45 #endif // NT_LOG_H_
Definition: Log.h:16