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:
@@ -265,6 +265,10 @@ void CS_RemoveListener(CS_Listener handle, CS_Status* status) {
|
||||
|
||||
int CS_NotifierDestroyed(void) { return cs::NotifierDestroyed(); }
|
||||
|
||||
void CS_SetLogger(CS_LogFunc func, unsigned int min_level) {
|
||||
cs::SetLogger(func, min_level);
|
||||
}
|
||||
|
||||
CS_Source* CS_EnumerateSources(int* count, CS_Status* status) {
|
||||
llvm::SmallVector<CS_Source, 32> buf;
|
||||
auto handles = cs::EnumerateSourceHandles(buf, status);
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
#include "llvm/SmallString.h"
|
||||
|
||||
#include "Log.h"
|
||||
#include "NetworkListener.h"
|
||||
#include "Notifier.h"
|
||||
#include "SinkImpl.h"
|
||||
@@ -511,6 +512,15 @@ void RemoveListener(CS_Listener handle, CS_Status* status) {
|
||||
|
||||
bool NotifierDestroyed() { return Notifier::destroyed(); }
|
||||
|
||||
//
|
||||
// Logging Functions
|
||||
//
|
||||
void SetLogger(LogFunc func, unsigned int min_level) {
|
||||
Logger& logger = Logger::GetInstance();
|
||||
logger.SetLogger(func);
|
||||
logger.set_min_level(min_level);
|
||||
}
|
||||
|
||||
//
|
||||
// Utility Functions
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user