mirror of
https://github.com/djhackersdev/bemanitools.git
synced 2026-08-22 08:24:02 -05:00
feat: Add helper to setup logger with null sink
Summary: Test Plan:
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include "core/log-sink-file.h"
|
||||
#include "core/log-sink-list.h"
|
||||
#include "core/log-sink-mutex.h"
|
||||
#include "core/log-sink-null.h"
|
||||
#include "core/log-sink-std.h"
|
||||
|
||||
// so we can log data dumps of rs232 streams without crashing
|
||||
@@ -15,6 +16,18 @@
|
||||
// 64 kb * 64 = 4 MB for logging total
|
||||
#define CORE_LOG_BT_EXT_ASYNC_QUEUE_LENGTH 64
|
||||
|
||||
void core_log_bt_ext_init_with_null()
|
||||
{
|
||||
core_log_sink_t sink;
|
||||
|
||||
core_log_sink_null_open(&sink);
|
||||
|
||||
// Size doesn't matter (but must be valid)
|
||||
// logger is entirely disabled
|
||||
core_log_bt_init(1024, &sink);
|
||||
core_log_bt_level_set(CORE_LOG_BT_LOG_LEVEL_OFF);
|
||||
}
|
||||
|
||||
void core_log_bt_ext_init_with_stdout()
|
||||
{
|
||||
core_log_sink_t sink;
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
void core_log_bt_ext_init_with_null();
|
||||
|
||||
/**
|
||||
* Helper to setup the bemanitools log implementation with a stdout sink.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user