mirror of
https://github.com/ggerganov/ggwave.git
synced 2026-03-27 22:40:29 +08:00
Add interface for changing ggwave's internal logging (#52)
* ggwave : add interface for changing ggwave's internal logging Using GGWave::setLogFile() it is now possible to change the log file used internally by ggwave, or disable it all together. * ggwave : add comments about thread-safety of setLogFile
This commit is contained in:
@@ -90,6 +90,23 @@ extern "C" {
|
||||
// the python module and unfortunately had to do it this way
|
||||
typedef int ggwave_Instance;
|
||||
|
||||
// Change file stream for internal ggwave logging. NULL - disable logging
|
||||
//
|
||||
// Intentionally passing it as void * instead of FILE * to avoid including a header
|
||||
//
|
||||
// // log to standard error
|
||||
// ggwave_setLogFile(stderr);
|
||||
//
|
||||
// // log to standard output
|
||||
// ggwave_setLogFile(stdout);
|
||||
//
|
||||
// // disable logging
|
||||
// ggwave_setLogFile(NULL);
|
||||
//
|
||||
// Note: not thread-safe. Do not call while any GGWave instances are running
|
||||
//
|
||||
GGWAVE_API void ggwave_setLogFile(void * fptr);
|
||||
|
||||
// Helper method to get default instance parameters
|
||||
GGWAVE_API ggwave_Parameters ggwave_getDefaultParameters(void);
|
||||
|
||||
@@ -306,6 +323,15 @@ public:
|
||||
GGWave(const Parameters & parameters);
|
||||
~GGWave();
|
||||
|
||||
// set file stream for the internal ggwave logging
|
||||
//
|
||||
// By default, ggwave prints internal log messages to stderr.
|
||||
// To disable logging all together, call this method with nullptr.
|
||||
//
|
||||
// Note: not thread-safe. Do not call while any GGWave instances are running
|
||||
//
|
||||
static void setLogFile(FILE * fptr);
|
||||
|
||||
static const Parameters & getDefaultParameters();
|
||||
|
||||
// set Tx data to encode
|
||||
|
||||
Reference in New Issue
Block a user