log.h

Go to the documentation of this file.
00001 #ifndef INCLUDES_MYSQL_INSTANCE_MANAGER_LOG_H
00002 #define INCLUDES_MYSQL_INSTANCE_MANAGER_LOG_H
00003 /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
00004 
00005    This program is free software; you can redistribute it and/or modify
00006    it under the terms of the GNU General Public License as published by
00007    the Free Software Foundation; either version 2 of the License, or
00008    (at your option) any later version.
00009 
00010    This program is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013    GNU General Public License for more details.
00014 
00015    You should have received a copy of the GNU General Public License
00016    along with this program; if not, write to the Free Software
00017    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
00018 
00019 /*
00020   Logging facilities. 
00021 
00022   Two logging streams are supported: error log and info log. Additionally
00023   libdbug may be used for debug information output.
00024   ANSI C buffered I/O is used to perform logging.
00025   Logging may be performed in two modes: 
00026   - console application mode (default), stdout/stderr is used for logging
00027   init_logs() must be called to initialize logging environment
00028   - daemon mode, without controlling terminal, call
00029   init_logs_in_daemon_mode() to initialize
00030   
00031   Rationale:
00032   - no MYSQL_LOG as it has BIN mode, and not easy to fetch from sql_class.h
00033   - no constructors/desctructors to make logging available all the time
00034   Function names are subject to change.
00035 */
00036 
00037 
00038 /* Precede error message with date and time and print it to the stdout */
00039 void log_info(const char *format, ...)
00040 #ifdef __GNUC__
00041         __attribute__ ((format(printf, 1, 2)))
00042 #endif
00043   ;
00044 
00045 
00046 /* Precede error message with date and time and print it to the stderr */
00047 void log_error(const char *format, ...)
00048 #ifdef __GNUC__
00049         __attribute__ ((format (printf, 1, 2)))
00050 #endif
00051   ;
00052 
00053 
00054 /*
00055   Now this is simple catchouts for printf (no date/time is logged), to be
00056   able to replace underlying streams in future.
00057 */
00058 
00059 void print_info(const char *format, ...)
00060 #ifdef __GNUC__
00061         __attribute__ ((format (printf, 1, 2)))
00062 #endif
00063   ;
00064 
00065 
00066 void print_error(const char *format, ...)
00067 #ifdef __GNUC__
00068         __attribute__ ((format (printf, 1, 2)))
00069 #endif
00070   ;
00071 
00072 /*  initialize logs */
00073 void log_init();
00074 
00075 
00076 /* print information to the error log and eixt(1) */  
00077 
00078 void die(const char *format, ...)
00079 #ifdef __GNUC__
00080         __attribute__ ((format (printf, 1, 2)))
00081 #endif
00082   ;
00083 
00084 #endif // INCLUDES_MYSQL_INSTANCE_MANAGER_LOG_H

Generated on Thu Feb 24 10:22:31 2005 for MySQL by  doxygen 1.3.9.1