2014-02-26 07:51:06 +01:00
|
|
|
/* log.h
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Copyright (C) 2014 Toxic All Rights Reserved.
|
|
|
|
*
|
|
|
|
* This file is part of Toxic.
|
|
|
|
*
|
|
|
|
* Toxic is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Toxic is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with Toxic. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2014-03-04 01:21:52 +01:00
|
|
|
/* Creates/fetches log file by appending to the config dir the name and a pseudo-unique identity */
|
2014-03-01 13:10:44 +01:00
|
|
|
void init_logging_session(uint8_t *name, uint8_t *key, struct chatlog *log);
|
2014-02-26 12:35:19 +01:00
|
|
|
|
2014-03-04 01:21:52 +01:00
|
|
|
/* formats/writes line to log file */
|
|
|
|
void write_to_log(uint8_t *msg, uint8_t *name, struct chatlog *log, bool event);
|
2014-03-01 13:10:44 +01:00
|
|
|
|
2014-03-04 01:21:52 +01:00
|
|
|
/* enables logging for specified log and creates/fetches file if necessary */
|
2014-03-02 00:06:35 +01:00
|
|
|
void log_enable(uint8_t *name, uint8_t *key, struct chatlog *log);
|
2014-03-04 01:21:52 +01:00
|
|
|
|
|
|
|
/* disables logging for specified log and closes file */
|
2014-03-02 00:06:35 +01:00
|
|
|
void log_disable(struct chatlog *log);
|