Add external logger interface.

This commit is contained in:
Peter Johnson
2016-12-10 23:49:50 -08:00
parent 2b8b8e7403
commit 28a2ba4bf8
6 changed files with 117 additions and 0 deletions

View File

@@ -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
//