#ifndef CGUL_LOG_TO_FILE_H #define CGUL_LOG_TO_FILE_H #include #include #include #include #include #include #include #include #include #include #define MAX_TIME_STRING_SIZE 256 #define MAX_LOG_MESSAGE_SIZE 2048 typedef enum { CGUL_SYSLOG = 1 << 0, CGUL_LOGFILE = 1 << 1, CGUL_STDERR = 1 << 2, CGUL_STDDEBUG = 1 << 3 } CGUL_LOGMASK; FILE* log_file_fp; char* ident_str; char* pid_str; CGUL_LOGMASK log_options; void cgul_log(int priority, const char* format, ...); int cgul_openlog(char* file); int cgul_closelog(void); int cgul_flushlog(void); void log_to_file(int priority, const char* format, va_list ap); void cgul_set_ident(char* ident); void cgul_set_log_options(CGUL_LOGMASK); CGUL_LOGMASK cgul_get_log_options(void); char* append_newline(const char* string); char* strip_newline(const char* string); #endif /* CGUL_LOG_TO_FILE_H */