Location of protocol logfile: $XDG_CONFIG_HOME/$CFG_NAME/logfile
.
More...
Macros | |
#define | MAIN_ERR_PREFIX "LOG: " |
Message prefix for LOG module. | |
#define | LOG_PERM (posix_mode_t) (POSIX_S_IRUSR | POSIX_S_IWUSR) |
Permissions for server protocol logfile. | |
Functions | |
const char * | log_get_logpathname (void) |
Get logfile pathname. More... | |
void | log_delete_logfile (void) |
Delete logfile if present. | |
int | log_open_logfile (FILE **lfs, const char *logfile) |
Open logfile. More... | |
void | log_close_logfile (FILE **lfs) |
Close logfile. More... | |
void | log_add (FILE *lfs, const char *data) |
Add data to end of logfile. More... | |
void | log_free (void *p) |
Free an object allocated by logging module. More... | |
Location of protocol logfile: $XDG_CONFIG_HOME/$CFG_NAME/logfile
.
void log_add | ( | FILE * | lfs, |
const char * | data | ||
) |
void log_close_logfile | ( | FILE ** | lfs | ) |
Close logfile.
[in] | lfs | Pointer to logfile stream |
Definition at line 158 of file log.c.
References fu_close_file().
void log_free | ( | void * | p | ) |
const char* log_get_logpathname | ( | void | ) |
Get logfile pathname.
This function must be thread safe. The caller is responsible to free the memory for the buffer on success.
NULL
on error Definition at line 55 of file log.c.
References fu_create_path(), xdg_append_to_path(), and xdg_get_confdir().
Referenced by log_delete_logfile().
int log_open_logfile | ( | FILE ** | lfs, |
const char * | logfile | ||
) |
Open logfile.
[out] | lfs | Pointer to logfile stream |
[in] | logfile | Pathname of logfile to open |
A valid stream pointer was written to lfs before success is returned. Otherwise the location pointed to by lfs is not changed.
NULL
, the file /dev/null
is used instead.Definition at line 114 of file log.c.
References fu_assign_stream(), fu_close_file(), fu_open_file(), LOG_PERM, and PRINT_ERROR.