MySQL  8.0.27
Source Code Documentation
service_my_plugin_log.h
Go to the documentation of this file.
1 /* Copyright (c) 2011, 2021, Oracle and/or its affiliates.
2 
3  This program is free software; you can redistribute it and/or modify
4  it under the terms of the GNU General Public License, version 2.0,
5  as published by the Free Software Foundation.
6 
7  This program is also distributed with certain software (including
8  but not limited to OpenSSL) that is licensed under separate terms,
9  as designated in a particular file or component or in included license
10  documentation. The authors of MySQL hereby grant you an additional
11  permission to link the program and your derivative works with the
12  separately licensed software that they have included with MySQL.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License, version 2.0, for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program; if not, write to the Free Software
21  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22 
23 /**
24  @file include/mysql/service_my_plugin_log.h
25  This service provides functions to report error conditions and log to
26  mysql error log.
27 */
28 
29 #ifndef MYSQL_SERVICE_MY_PLUGIN_LOG_INCLUDED
30 #define MYSQL_SERVICE_MY_PLUGIN_LOG_INCLUDED
31 
32 #ifndef MYSQL_ABI_CHECK
33 #include <stdarg.h>
34 #endif
35 
36 /* keep in sync with the loglevel enum in my_sys.h */
41 };
42 
43 /**
44  @ingroup group_ext_plugin_services
45 
46  Enables plugins to log messages into the server's error log.
47 */
48 extern "C" struct my_plugin_log_service {
49  /** Write a message to the log */
51  const char *, ...)
52  MY_ATTRIBUTE((format(printf, 3, 4)));
54 
55 #ifdef MYSQL_DYNAMIC_PLUGIN
56 
57 #define my_plugin_log_message my_plugin_log_service->my_plugin_log_message
58 
59 #else
60 
62  const char *format, ...)
63  MY_ATTRIBUTE((format(printf, 3, 4)));
64 
65 #endif
66 
67 #endif
struct my_plugin_log_service * my_plugin_log_service
void * MYSQL_PLUGIN
Definition: plugin.h:81
plugin_log_level
Definition: service_my_plugin_log.h:37
@ MY_ERROR_LEVEL
Definition: service_my_plugin_log.h:38
@ MY_WARNING_LEVEL
Definition: service_my_plugin_log.h:39
@ MY_INFORMATION_LEVEL
Definition: service_my_plugin_log.h:40
int my_plugin_log_message(MYSQL_PLUGIN *plugin, enum plugin_log_level level, const char *format,...)
Definition: log.cc:2348
Enables plugins to log messages into the server's error log.
Definition: service_my_plugin_log.h:48
int(* my_plugin_log_message)(MYSQL_PLUGIN *, enum plugin_log_level, const char *,...)
Write a message to the log.
Definition: service_my_plugin_log.h:50