1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Polishing:

- change some return types from int to bool;
  - add [ERROR] tag to log_error() output;
  - add [INFO] tag to log_info() output;
  - change log messages to be more consistent.


server-tools/instance-manager/IMService.cpp:
  Log polishing.
server-tools/instance-manager/commands.cc:
  Log polishing.
server-tools/instance-manager/commands.h:
  Eliminate warnings.
server-tools/instance-manager/instance.cc:
  Log polishing.
server-tools/instance-manager/instance_map.cc:
  Log polishing.
server-tools/instance-manager/instance_options.cc:
  1) Log polishing.
  2) Change int-return type to bool.
server-tools/instance-manager/instance_options.h:
  Change int-return type to bool.
server-tools/instance-manager/listener.cc:
  Log polishing.
server-tools/instance-manager/log.cc:
  Log polishing.
server-tools/instance-manager/log.h:
  Log polishing.
server-tools/instance-manager/manager.cc:
  Log polishing.
server-tools/instance-manager/mysql_connection.cc:
  Log polishing.
server-tools/instance-manager/mysql_connection.h:
  Change int-return type to bool.
server-tools/instance-manager/mysqlmanager.cc:
  Log polishing.
server-tools/instance-manager/priv.cc:
  Log polishing.
server-tools/instance-manager/thread_registry.cc:
  1. Print pthread_t as (unsigned long), not as (signed long)
  to avoid negative identifiers in output.
  2. Print thread id after it will be initialized, not before.
server-tools/instance-manager/user_map.cc:
  Log polishing.
This commit is contained in:
unknown
2006-11-21 17:47:14 +03:00
parent cbfff7304d
commit 7c35c3d5e6
17 changed files with 270 additions and 210 deletions

View File

@ -19,20 +19,23 @@
/*
Logging facilities.
Two logging streams are supported: error log and info log. Additionally
libdbug may be used for debug information output.
Two logging streams are supported: error log and info log.
Additionally libdbug may be used for debug information output.
ANSI C buffered I/O is used to perform logging.
Logging is performed via stdout/stder, so one can reopen them to point to
ordinary files. To initialize loggin environment log_init() must be called.
ordinary files. To initialize logging environment log_init() must be called.
Rationale:
- no MYSQL_LOG as it has BIN mode, and not easy to fetch from sql_class.h
- no constructors/desctructors to make logging available all the time
Function names are subject to change.
*/
/* Precede error message with date and time and print it to the stdout */
void log_init();
void log_info(const char *format, ...)
#ifdef __GNUC__
__attribute__ ((format(printf, 1, 2)))
@ -40,7 +43,6 @@ void log_info(const char *format, ...)
;
/* Precede error message with date and time and print it to the stderr */
void log_error(const char *format, ...)
#ifdef __GNUC__
__attribute__ ((format (printf, 1, 2)))
@ -48,30 +50,6 @@ void log_error(const char *format, ...)
;
/*
Now this is simple catchouts for printf (no date/time is logged), to be
able to replace underlying streams in future.
*/
void print_info(const char *format, ...)
#ifdef __GNUC__
__attribute__ ((format (printf, 1, 2)))
#endif
;
void print_error(const char *format, ...)
#ifdef __GNUC__
__attribute__ ((format (printf, 1, 2)))
#endif
;
/* initialize logs */
void log_init();
/* print information to the error log and eixt(1) */
void die(const char *format, ...)
#ifdef __GNUC__
__attribute__ ((format (printf, 1, 2)))