tlog: update tlog
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* tinylog
|
* tinylog
|
||||||
* Copyright (C) 2018-2019 Nick Peng <pymumu@gmail.com>
|
* Copyright (C) 2018-2020 Nick Peng <pymumu@gmail.com>
|
||||||
* https://github.com/pymumu/tinylog
|
* https://github.com/pymumu/tinylog
|
||||||
*/
|
*/
|
||||||
#ifndef _GNU_SOURCE
|
#ifndef _GNU_SOURCE
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* tinylog
|
* tinylog
|
||||||
* Copyright (C) 2018-2019 Ruilin Peng (Nick) <pymumu@gmail.com>
|
* Copyright (C) 2018-2020 Ruilin Peng (Nick) <pymumu@gmail.com>
|
||||||
* https://github.com/pymumu/tinylog
|
* https://github.com/pymumu/tinylog
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -196,6 +196,7 @@ public:
|
|||||||
Buffer LogStream(tlog_level level, const char *file, int line, const char *func, void *userptr) {
|
Buffer LogStream(tlog_level level, const char *file, int line, const char *func, void *userptr) {
|
||||||
return Buffer(new Stream, [=](Stream *st) {
|
return Buffer(new Stream, [=](Stream *st) {
|
||||||
tlog_ext(level, file, line, func, userptr, "%s", st->str().c_str());
|
tlog_ext(level, file, line, func, userptr, "%s", st->str().c_str());
|
||||||
|
delete st;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -215,6 +216,7 @@ public:
|
|||||||
Buffer Out(tlog_log *log) {
|
Buffer Out(tlog_log *log) {
|
||||||
return Buffer(new Stream, [=](Stream *st) {
|
return Buffer(new Stream, [=](Stream *st) {
|
||||||
tlog_printf(log, "%s", st->str().c_str());
|
tlog_printf(log, "%s", st->str().c_str());
|
||||||
|
delete st;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user