log.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  log_types {
  LOG_ERROR = 0x0001, LOG_WARNING = 0x0002, LOG_INFO = 0x0004, LOG_DEBUG = 0x0008,
  LOG_D_OTHER = 0x0100 | LOG_DEBUG, LOG_D_SQL = 0x0200 | LOG_DEBUG, LOG_D_CALL = 0x0400 | LOG_DEBUG, LOG_D_POOL = 0x0800 | LOG_DEBUG,
  LOG_MASK_MAJOR = 0x000F, LOG_MASK_MINOR = 0xFF00
}
 defines logging-levels similar to syslog More...

Functions

int log_printf (enum log_types type, const char *logmsg,...)
 log a variable-format/token log message
FILE * log_init (const char *filename, int verbose)
 initialize the log.
void log_finish (FILE *f)
 close the log file

Variables

FILE * log_file
 FILE representing the open log file.
int log_types_mask
 bitfield of the log levels that are to be logged to the log_file.


Detailed Description

Definition in file log.h.


Enumeration Type Documentation

enum log_types

defines logging-levels similar to syslog

Enumerator:
LOG_ERROR 
LOG_WARNING 
LOG_INFO 
LOG_DEBUG 
LOG_D_OTHER 
LOG_D_SQL 
LOG_D_CALL 
LOG_D_POOL 
LOG_MASK_MAJOR 
LOG_MASK_MINOR 

Definition at line 19 of file log.h.


Function Documentation

void log_finish ( FILE *  f  ) 

close the log file

Definition at line 98 of file log.c.

FILE* log_init ( const char *  filename,
int  verbose 
)

initialize the log.

If "stdout" or "stderr" are used, the existing streams will be returned.

Returns:
a pointer to the newly-opened log file, or stdout or stderr if those strings are used
Parameters:
filename name of file to use
verbose print a message to show the filename being opened

Definition at line 70 of file log.c.

Referenced by main().

int log_printf ( enum log_types  type,
const char *  logmsg,
  ... 
)

log a variable-format/token log message

Definition at line 43 of file log.c.

References BUFSIZE, LOG_DEBUG, log_debug_mask, log_file, LOG_MASK_MAJOR, LOG_MASK_MINOR, and log_types_mask.

Referenced by main(), pool_cleanup(), pool_get(), pool_init(), pool_put(), query_chmod(), query_chown(), query_fsck(), query_getattr(), query_inode_full(), query_inuse_inc(), query_mkdirentry(), query_mknod(), query_purge_deleted(), query_read(), query_readdir(), query_rename(), query_rmdirentry(), query_set_deleted(), query_size(), query_size_block(), query_truncate(), and query_utime().


Variable Documentation

FILE* log_file

FILE representing the open log file.

Defaulting to stderr, this file is defined by log_init() in main() when the "-ologfile=" option is used

Definition at line 22 of file log.c.

Referenced by log_printf(), and main().

int log_types_mask

bitfield of the log levels that are to be logged to the log_file.

Defaults to LOG_ERROR | LOG_INFO

Definition at line 24 of file log.c.

Referenced by log_printf().


Generated on Sun Jul 12 20:25:26 2009 for mysqlfs by  doxygen 1.4.7