inc/log.h

Go to the documentation of this file.
00001 /* log.h - logging for servers, can log to a file and/or syslog.  Compile with
00002  * -DNO_SYSLOG for systems without syslog. */
00003 
00004 #ifndef LOG_H
00005 #define LOG_H
00006 
00007 void logOpenSyslog(char* program, char *facility);
00008 /* Initialize syslog using the specified facility.  Facility is the syslog
00009  * facility as specified in syslog.conf.  If facility is NULL, local0 is used.
00010  * This adds a warn and errAbort handlers that do logging.  If custom handlers
00011  * are added, they should call logErrorVa().
00012  */
00013 
00014 void logOpenFile(char* program, char *logFile);
00015 /* Initialize logging to the specified file.  Append to the file if it exists.
00016  * This adds a warn and errAbort handlers that do logging.  If custom handlers
00017  * are added, they should call logErrorVa(). 
00018  */
00019 
00020 FILE *logGetFile();
00021 /* Returns the log FILE object if file logging is enabled, or NULL if it
00022  * isn't. This is useful for logging debugging data that doesn't fit the log
00023  * message paradigm, For example, logging fasta records. */
00024 
00025 void logErrorVa(char *format, va_list args);
00026 /* Variable args logError. */
00027 
00028 void logError(char *format, ...)
00029 /* Log an error message. */
00030 #if defined(__GNUC__) && defined(JK_WARN)
00031 __attribute__((format(printf, 1, 2)))
00032 #endif
00033 ;
00034 
00035 void logWarnVa(char *format, va_list args);
00036 /* Variable args logWarn. */
00037 
00038 void logWarn(char *format, ...)
00039 /* Log a warn message. */
00040 #if defined(__GNUC__) && defined(JK_WARN)
00041 __attribute__((format(printf, 1, 2)))
00042 #endif
00043 ;
00044 
00045 void logInfoVa(char *format, va_list args);
00046 /* Variable args logInfo. */
00047 
00048 void logInfo(char *format, ...)
00049 /* Log an info message. */
00050 #if defined(__GNUC__) && defined(JK_WARN)
00051 __attribute__((format(printf, 1, 2)))
00052 #endif
00053 ;
00054 
00055 void logDebugVa(char *format, va_list args);
00056 /* Variable args logDebug. */
00057 
00058 void logDebug(char *format, ...)
00059 /* Log a debug message. */
00060 #if defined(__GNUC__) && defined(JK_WARN)
00061 __attribute__((format(printf, 1, 2)))
00062 #endif
00063 ;
00064 
00065 void logDaemonize(char *progName);
00066 /* daemonize server process: closing open file descriptors and
00067  * starting logging based on the -logFacility and -log command line options .
00068  * if -debug is supplied , don't fork. */
00069 
00070 #endif

Generated on Tue Dec 25 18:39:29 2007 for blat by  doxygen 1.5.2