WPILibC++ 2023.4.3-108-ge5452e3
Logger.h File Reference
#include <functional>
#include <utility>
#include "fmt/format.h"

Go to the source code of this file.

Classes

class  wpi::Logger
 

Namespaces

namespace  wpi
 

Macros

#define WPI_LOG(logger_inst, level, format, ...)
 
#define WPI_ERROR(inst, format, ...)    WPI_LOG(inst, ::wpi::WPI_LOG_ERROR, format __VA_OPT__(, ) __VA_ARGS__)
 
#define WPI_WARNING(inst, format, ...)    WPI_LOG(inst, ::wpi::WPI_LOG_WARNING, format __VA_OPT__(, ) __VA_ARGS__)
 
#define WPI_INFO(inst, format, ...)    WPI_LOG(inst, ::wpi::WPI_LOG_INFO, format __VA_OPT__(, ) __VA_ARGS__)
 
#define WPI_DEBUG(inst, format, ...)    WPI_LOG(inst, ::wpi::WPI_LOG_DEBUG, format __VA_OPT__(, ) __VA_ARGS__)
 
#define WPI_DEBUG1(inst, format, ...)    WPI_LOG(inst, ::wpi::WPI_LOG_DEBUG1, format __VA_OPT__(, ) __VA_ARGS__)
 
#define WPI_DEBUG2(inst, format, ...)    WPI_LOG(inst, ::wpi::WPI_LOG_DEBUG2, format __VA_OPT__(, ) __VA_ARGS__)
 
#define WPI_DEBUG3(inst, format, ...)    WPI_LOG(inst, ::wpi::WPI_LOG_DEBUG3, format __VA_OPT__(, ) __VA_ARGS__)
 
#define WPI_DEBUG4(inst, format, ...)    WPI_LOG(inst, ::wpi::WPI_LOG_DEBUG4, format __VA_OPT__(, ) __VA_ARGS__)
 

Enumerations

enum  wpi::LogLevel {
  wpi::WPI_LOG_CRITICAL = 50 , wpi::WPI_LOG_ERROR = 40 , wpi::WPI_LOG_WARNING = 30 , wpi::WPI_LOG_INFO = 20 ,
  wpi::WPI_LOG_DEBUG = 10 , wpi::WPI_LOG_DEBUG1 = 9 , wpi::WPI_LOG_DEBUG2 = 8 , wpi::WPI_LOG_DEBUG3 = 7 ,
  wpi::WPI_LOG_DEBUG4 = 6
}
 

Macro Definition Documentation

◆ WPI_DEBUG

#define WPI_DEBUG (   inst,
  format,
  ... 
)     WPI_LOG(inst, ::wpi::WPI_LOG_DEBUG, format __VA_OPT__(, ) __VA_ARGS__)

◆ WPI_DEBUG1

#define WPI_DEBUG1 (   inst,
  format,
  ... 
)     WPI_LOG(inst, ::wpi::WPI_LOG_DEBUG1, format __VA_OPT__(, ) __VA_ARGS__)

◆ WPI_DEBUG2

#define WPI_DEBUG2 (   inst,
  format,
  ... 
)     WPI_LOG(inst, ::wpi::WPI_LOG_DEBUG2, format __VA_OPT__(, ) __VA_ARGS__)

◆ WPI_DEBUG3

#define WPI_DEBUG3 (   inst,
  format,
  ... 
)     WPI_LOG(inst, ::wpi::WPI_LOG_DEBUG3, format __VA_OPT__(, ) __VA_ARGS__)

◆ WPI_DEBUG4

#define WPI_DEBUG4 (   inst,
  format,
  ... 
)     WPI_LOG(inst, ::wpi::WPI_LOG_DEBUG4, format __VA_OPT__(, ) __VA_ARGS__)

◆ WPI_ERROR

#define WPI_ERROR (   inst,
  format,
  ... 
)     WPI_LOG(inst, ::wpi::WPI_LOG_ERROR, format __VA_OPT__(, ) __VA_ARGS__)

◆ WPI_INFO

#define WPI_INFO (   inst,
  format,
  ... 
)     WPI_LOG(inst, ::wpi::WPI_LOG_INFO, format __VA_OPT__(, ) __VA_ARGS__)

◆ WPI_LOG

#define WPI_LOG (   logger_inst,
  level,
  format,
  ... 
)
Value:
if ((logger_inst).HasLogger() && level >= (logger_inst).min_level()) { \
(logger_inst) \
.Log(level, __FILE__, __LINE__, \
FMT_STRING(format) __VA_OPT__(, ) __VA_ARGS__); \
}
#define FMT_STRING(s)
\rst Constructs a compile-time format string from a string literal s.
Definition: format.h:1780
auto format(wformat_string< T... > fmt, T &&... args) -> std::wstring
Definition: xchar.h:87

◆ WPI_WARNING

#define WPI_WARNING (   inst,
  format,
  ... 
)     WPI_LOG(inst, ::wpi::WPI_LOG_WARNING, format __VA_OPT__(, ) __VA_ARGS__)