diff options
author | pranomostro <pranomestro@gmail.com> | 2017-02-17 12:48:47 +0100 |
---|---|---|
committer | pranomostro <pranomestro@gmail.com> | 2017-02-18 01:49:44 +0100 |
commit | c567ccfbe4f75beb10a063d3db0999195d141774 (patch) | |
tree | c61fc546e320966cc0462fa1129af1776ced9b1b | |
parent | e66d4bff86cb9e4832c98968f1751097ed57ede0 (diff) |
Add ability to toggle message logging to stdout in config.h.
-rw-r--r-- | config.def.h | 3 | ||||
-rw-r--r-- | ratox.c | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/config.def.h b/config.def.h index aa95a0e..e98c1ed 100644 --- a/config.def.h +++ b/config.def.h @@ -20,6 +20,9 @@ #define VIDEOHEIGHT 720 #define VIDEOBITRATE 2500 +static int friendmsg_log = 1; +static int confmsg_log = 0; + static char *savefile = ".ratox.tox"; static int encryptsavefile = 0; @@ -555,6 +555,8 @@ cbconfmessage(Tox *m, uint32_t cnum, uint32_t pnum, TOX_MESSAGE_TYPE type, const } namt[tox_conference_peer_get_name_size(tox, c->num, pnum, NULL)] = '\0'; dprintf(c->fd[CTEXT_OUT], "%s <%s> %s\n", buft, namt, msg); + if (confmsg_log) + logmsg("%s <%s> %s\n", buft, namt, msg); break; } } @@ -744,7 +746,8 @@ cbfriendmessage(Tox *m, uint32_t frnum, TOX_MESSAGE_TYPE type, const uint8_t *da t = time(NULL); strftime(buft, sizeof(buft), "%F %R", localtime(&t)); dprintf(f->fd[FTEXT_OUT], "%s %s\n", buft, msg); - logmsg(": %s > %s\n", f->name, msg); + if (friendmsg_log) + logmsg(": %s > %s\n", f->name, msg); break; } } |