WPILibC++ 2025.1.1
Loading...
Searching...
No Matches
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
 Foonathan namespace.
 

Macros

#define WPI_LOG(logger_inst, level, format, ...)
 
#define WPI_ERROR(inst, format, ...)
 
#define WPI_WARNING(inst, format, ...)
 
#define WPI_INFO(inst, format, ...)
 
#define WPI_DEBUG(inst, format, ...)
 
#define WPI_DEBUG1(inst, format, ...)
 
#define WPI_DEBUG2(inst, format, ...)
 
#define WPI_DEBUG3(inst, format, ...)
 
#define WPI_DEBUG4(inst, format, ...)
 

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,
... )
Value:
WPI_LOG(inst, ::wpi::WPI_LOG_DEBUG, format __VA_OPT__(, ) __VA_ARGS__)
#define WPI_LOG(logger_inst, level, format,...)
Definition Logger.h:69
FMT_INLINE auto format(detail::locale_ref loc, format_string< T... > fmt, T &&... args) -> std::string
Definition format.h:4146
@ WPI_LOG_DEBUG
Definition Logger.h:20

◆ WPI_DEBUG1

#define WPI_DEBUG1 ( inst,
format,
... )
Value:
WPI_LOG(inst, ::wpi::WPI_LOG_DEBUG1, format __VA_OPT__(, ) __VA_ARGS__)
@ WPI_LOG_DEBUG1
Definition Logger.h:21

◆ WPI_DEBUG2

#define WPI_DEBUG2 ( inst,
format,
... )
Value:
WPI_LOG(inst, ::wpi::WPI_LOG_DEBUG2, format __VA_OPT__(, ) __VA_ARGS__)
@ WPI_LOG_DEBUG2
Definition Logger.h:22

◆ WPI_DEBUG3

#define WPI_DEBUG3 ( inst,
format,
... )
Value:
WPI_LOG(inst, ::wpi::WPI_LOG_DEBUG3, format __VA_OPT__(, ) __VA_ARGS__)
@ WPI_LOG_DEBUG3
Definition Logger.h:23

◆ WPI_DEBUG4

#define WPI_DEBUG4 ( inst,
format,
... )
Value:
WPI_LOG(inst, ::wpi::WPI_LOG_DEBUG4, format __VA_OPT__(, ) __VA_ARGS__)
@ WPI_LOG_DEBUG4
Definition Logger.h:24

◆ WPI_ERROR

#define WPI_ERROR ( inst,
format,
... )
Value:
WPI_LOG(inst, ::wpi::WPI_LOG_ERROR, format __VA_OPT__(, ) __VA_ARGS__)
@ WPI_LOG_ERROR
Definition Logger.h:17

◆ WPI_INFO

#define WPI_INFO ( inst,
format,
... )
Value:
WPI_LOG(inst, ::wpi::WPI_LOG_INFO, format __VA_OPT__(, ) __VA_ARGS__)
@ WPI_LOG_INFO
Definition Logger.h:19

◆ 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__, format __VA_OPT__(, ) __VA_ARGS__); \
}

◆ WPI_WARNING

#define WPI_WARNING ( inst,
format,
... )
Value:
WPI_LOG(inst, ::wpi::WPI_LOG_WARNING, format __VA_OPT__(, ) __VA_ARGS__)
@ WPI_LOG_WARNING
Definition Logger.h:18