#include "config.h"
#include "logfile.h"
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <syslog.h>
#include <libintl.h>
#include "output.h"
#include "len.h"
Go to the source code of this file.
◆ TMP_LOGFILE_TEMPLATE
| #define TMP_LOGFILE_TEMPLATE "logfile.XXXXXX" |
◆ TMPDIR
◆ close_logfile()
| void close_logfile |
( |
FILE ** |
fd | ) |
|
Close an opened log file and reset the file descriptor.
- Parameters
-
| [in,out] | fd | Pointer to a file descriptor pointer, this will be NULL afterwards. |
Definition at line 139 of file logfile.c.
◆ mk_logfile()
| FILE* mk_logfile |
( |
FILE * |
tmplogfp, |
|
|
const char * |
file |
|
) |
| |
create a new log file and moves the content from the temporary log file in it, afterwards it deletes the temporary log file.
- Parameters
-
| [in] | tmplogfp | File pointer return by mk_temp_logfile. |
| [in] | file | Pointer to a string representing the filename for the new log file. |
- Returns
- A file descriptor to the opened log file.
Definition at line 72 of file logfile.c.
◆ mk_temp_logfile()
| FILE* mk_temp_logfile |
( |
void |
| ) |
|
Make a temporary log file for early logging. This log file will be copied in an persistent log file by mk_logfile.
- Returns
- A file descriptor to an opened temporary log file.
Definition at line 26 of file logfile.c.
◆ remove_temp_logfile()
| void remove_temp_logfile |
( |
FILE ** |
tmplogfp | ) |
|
Remove the temporary log file. If you want to turn the temporary log file in a permanent one see mk_logfile.
- Parameters
-
| [in,out] | tmplogfp | Pointer to a file descriptor pointer, this is a reference to the return value of mk_temp_logfile. This will be NULL afterwards. |
Definition at line 56 of file logfile.c.