mirror of
https://github.com/profanity-im/profanity.git
synced 2025-01-03 14:57:42 -05:00
Flush after chat log writes
This commit is contained in:
parent
83ef1d562c
commit
8e02720a69
@ -25,26 +25,27 @@
|
||||
|
||||
#include "glib.h"
|
||||
|
||||
#include "log.h"
|
||||
#include "chat_log.h"
|
||||
#include "common.h"
|
||||
|
||||
static FILE *chatlog;
|
||||
|
||||
void chat_log_chat(const char * const user, const char * const msg)
|
||||
{
|
||||
fprintf(chatlog, "%s: %s\n", user, msg);
|
||||
}
|
||||
|
||||
void chat_log_init(void)
|
||||
{
|
||||
GString *log_file = g_string_new(getenv("HOME"));
|
||||
g_string_append(log_file, "/.profanity/log");
|
||||
create_dir(log_file->str);
|
||||
g_string_append(log_file, "/chat.log");
|
||||
logp = fopen(log_file->str, "a");
|
||||
chatlog = fopen(log_file->str, "a");
|
||||
g_string_free(log_file, TRUE);
|
||||
}
|
||||
|
||||
void chat_log_chat(const char * const user, const char * const msg)
|
||||
{
|
||||
fprintf(chatlog, "%s: %s\n", user, msg);
|
||||
fflush(chatlog);
|
||||
}
|
||||
|
||||
void chat_log_close(void)
|
||||
{
|
||||
fclose(chatlog);
|
||||
|
Loading…
Reference in New Issue
Block a user