mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-28 12:30:58 +00:00
Add mg_log_set_fn(), MG_ENABLE_LOG
This commit is contained in:
1 parent
0b5a00c99a
commit
9760b7c9d6
6 files changed
+69
-11
No files matched your search
@@ -1,10 +1,19 @@
|
||||
#include "log.h"
|
||||
#include "util.h"
|
||||
|
||||
static void default_logger(unsigned char c) {
|
||||
putchar(c);
|
||||
}
|
||||
|
||||
static const char *s_spec = "2";
|
||||
static void (*s_log_func)(unsigned char) = default_logger;
|
||||
|
||||
void mg_log_set_callback(void (*fn)(unsigned char)) {
|
||||
s_log_func = fn;
|
||||
}
|
||||
|
||||
static void logc(unsigned char c) {
|
||||
MG_PUTCHAR(c);
|
||||
s_log_func(c);
|
||||
}
|
||||
|
||||
static void logs(const char *buf, size_t len) {
|
||||
|
||||
Reference in new issue
Block a user