From 312de68e259fe03d6df09f7c7f0f7271c2350532 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Fri, 13 Dec 2013 10:15:52 +0100 Subject: Add new log-rotate feature and error handling on file log opening. --- hugin.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'hugin.h') diff --git a/hugin.h b/hugin.h index 8aabcf1..393ce1c 100644 --- a/hugin.h +++ b/hugin.h @@ -131,11 +131,21 @@ enum HUG_OPTION { * @param flags combination of HUG_FLAG values * @param ... list of options (type-value pairs, * terminated with HUG_OPTION_END). - * @return 0 on success, 1 on error. + * @return HUG_STATUS_OK on success, 1 on error. */ hug_status_t hug_init(unsigned int flags, ...); void hug_close(); +/** + * Use this function if hugin is logging to a file and this file has just been + * rotated. Hugin will then close the filedescriptor to the file and open + * the a new file with the same name and location. + * Be aware that logrotate might need to create this new file first with + * the correct permissions in order for hugin to write to it. + * @return 0 on success. HUG_STATUS_ERROR on error (cannot open file). + */ +hug_status_t hugin_reopen_log(); + /** * Example of usage (use mutex protected calls, send output to file): * -- cgit v1.2.3