mirror of
https://github.com/servalproject/serval-dna.git
synced 2024-12-22 06:27:51 +00:00
Improve logging -- first log INFO message
This commit is contained in:
parent
a6a81a0f64
commit
82648b7e63
2
log.c
2
log.c
@ -120,6 +120,7 @@ void vlogMessage(int level, const char *file, unsigned int line, const char *fun
|
|||||||
if (strbuf_is_empty(&logbuf))
|
if (strbuf_is_empty(&logbuf))
|
||||||
strbuf_init(&logbuf, _log_buf, sizeof _log_buf);
|
strbuf_init(&logbuf, _log_buf, sizeof _log_buf);
|
||||||
#ifndef ANDROID
|
#ifndef ANDROID
|
||||||
|
FILE *logf = open_logging();
|
||||||
const char *levelstr = "UNKWN:";
|
const char *levelstr = "UNKWN:";
|
||||||
switch (level) {
|
switch (level) {
|
||||||
case LOG_LEVEL_FATAL: levelstr = "FATAL:"; break;
|
case LOG_LEVEL_FATAL: levelstr = "FATAL:"; break;
|
||||||
@ -172,7 +173,6 @@ void vlogMessage(int level, const char *file, unsigned int line, const char *fun
|
|||||||
__android_log_print(alevel, "servald", "%s", strbuf_str(&logbuf));
|
__android_log_print(alevel, "servald", "%s", strbuf_str(&logbuf));
|
||||||
strbuf_reset(&logbuf);
|
strbuf_reset(&logbuf);
|
||||||
#else
|
#else
|
||||||
FILE *logf = open_logging();
|
|
||||||
if (logf) {
|
if (logf) {
|
||||||
fputs(strbuf_str(&logbuf), logf);
|
fputs(strbuf_str(&logbuf), logf);
|
||||||
if (strbuf_overrun(&logbuf))
|
if (strbuf_overrun(&logbuf))
|
||||||
|
Loading…
Reference in New Issue
Block a user