1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-02 17:46:45 +02:00

simplify logging

This commit is contained in:
Jfreegman
2014-03-03 19:21:52 -05:00
parent 7f38c3c6e7
commit 24b763bce6
6 changed files with 52 additions and 67 deletions

View File

@ -20,16 +20,14 @@
*
*/
/* gets the log path by appending to the config dir the name and a pseudo-unique identity */
/* Creates/fetches log file by appending to the config dir the name and a pseudo-unique identity */
void init_logging_session(uint8_t *name, uint8_t *key, struct chatlog *log);
/* Adds line/event to log_buf with timestamp and name. If buf is full, triggers write_to_log.
If event is true, formats line as an event, e.g. * name has gone offline */
void add_to_log_buf(uint8_t *msg, uint8_t *name, struct chatlog *log, bool event);
/* writes contents from a chatcontext's log buffer to respective log file and resets log pos.
This is triggered automatically when the log buffer is full, but may be forced. */
void write_to_log(struct chatlog *log);
/* formats/writes line to log file */
void write_to_log(uint8_t *msg, uint8_t *name, struct chatlog *log, bool event);
/* enables logging for specified log and creates/fetches file if necessary */
void log_enable(uint8_t *name, uint8_t *key, struct chatlog *log);
/* disables logging for specified log and closes file */
void log_disable(struct chatlog *log);