![]() |
SCTC
the soundcloud.com terminal client
|
#include "log.h"Functions | |
| bool | log_init (char *file) |
| void | __log (char *srcfile, int srcline, const char *srcfunc, char *fmt,...) |
| void | log_close () |
Variables | |
| static FILE * | log_fh = NULL |
| static sem_t | log_sem |
| void __log | ( | char * | srcfile, |
| int | srcline, | ||
| const char * | srcfunc, | ||
| char * | fmt, | ||
| ... | |||
| ) |
The internal implementation for logging.
This function is synchronized internally and therefore may be called by several threads 'at once'.
| srcfile | The file executing the call to __log(); filled by macro _log(), do not use "by hand" |
| srcline | The line in the file executing the call to __log(); filled by macro _log(), do not use "by hand" |
| srcfunc | The function callint __log(); filled by macro _log(), do not use "by hand" |
| fmt | The format used format the line, see man 3 printf for usage. |
| void log_close | ( | ) |
Finalize logging.
Closes any opened descriptors and frees any remaining memory allocated during usage. Any calls to _log() after call to log_close() do not have any effect.
Typically this function is only called prior to termination.
| bool log_init | ( | char * | file | ) |
Initialize logging.
Initialize logging and thus allow subsequent calls to _log().
Typically this function is called only once directly after starting up the execution
| file | The file to log to, either relative or absolute path. |
|
static |
|
static |
1.8.9.1