mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-05 03:21:42 +00:00
Add external logger interface.
This commit is contained in:
@@ -54,6 +54,21 @@ enum CS_StatusValue {
|
||||
CS_SOURCE_IS_DISCONNECTED = -2005
|
||||
};
|
||||
|
||||
//
|
||||
// Logging levels
|
||||
//
|
||||
enum CS_LogLevel {
|
||||
CS_LOG_CRITICAL = 50,
|
||||
CS_LOG_ERROR = 40,
|
||||
CS_LOG_WARNING = 30,
|
||||
CS_LOG_INFO = 20,
|
||||
CS_LOG_DEBUG = 10,
|
||||
CS_LOG_DEBUG1 = 9,
|
||||
CS_LOG_DEBUG2 = 8,
|
||||
CS_LOG_DEBUG3 = 7,
|
||||
CS_LOG_DEBUG4 = 6
|
||||
};
|
||||
|
||||
//
|
||||
// Pixel formats
|
||||
//
|
||||
@@ -285,6 +300,13 @@ void CS_RemoveListener(CS_Listener handle, CS_Status* status);
|
||||
|
||||
int CS_NotifierDestroyed(void);
|
||||
|
||||
//
|
||||
// Logging Functions
|
||||
//
|
||||
typedef void (*CS_LogFunc)(unsigned int level, const char* file,
|
||||
unsigned int line, const char* msg);
|
||||
void CS_SetLogger(CS_LogFunc func, unsigned int min_level);
|
||||
|
||||
//
|
||||
// Utility Functions
|
||||
//
|
||||
|
||||
@@ -278,6 +278,14 @@ void RemoveListener(CS_Listener handle, CS_Status* status);
|
||||
|
||||
bool NotifierDestroyed();
|
||||
|
||||
//
|
||||
// Logging Functions
|
||||
//
|
||||
typedef std::function<void(unsigned int level, const char* file,
|
||||
unsigned int line, const char* msg)>
|
||||
LogFunc;
|
||||
void SetLogger(LogFunc func, unsigned int min_level);
|
||||
|
||||
//
|
||||
// Utility Functions
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user