MySQL  8.0.22
Source Code Documentation
service_my_plugin_log.h
Go to the documentation of this file.
1 /* Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
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 #if defined __SUNPRO_C || defined __SUNPRO_CC || \
37  (defined _MSC_VER && !defined __clang__)
38 #define MY_ATTRIBUTE(A)
39 #endif
40 
41 /* keep in sync with the loglevel enum in my_sys.h */
46 };
47 
48 /**
49  @ingroup group_ext_plugin_services
50 
51  Enables plugins to log messages into the server's error log.
52 */
53 extern "C" struct my_plugin_log_service {
54  /** Write a message to the log */
56  const char *, ...)
57  MY_ATTRIBUTE((format(printf, 3, 4)));
59 
60 #ifdef MYSQL_DYNAMIC_PLUGIN
61 
62 #define my_plugin_log_message my_plugin_log_service->my_plugin_log_message
63 
64 #else
65 
66 int my_plugin_log_message(MYSQL_PLUGIN *plugin, enum plugin_log_level level,
67  const char *format, ...)
68  MY_ATTRIBUTE((format(printf, 3, 4)));
69 
70 #endif
71 
72 #endif
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:55
static struct st_mysql_daemon plugin
Definition: test_services_host_application_signal.cc:130
struct my_plugin_log_service * my_plugin_log_service
Enables plugins to log messages into the server&#39;s error log.
Definition: service_my_plugin_log.h:53
void * MYSQL_PLUGIN
Definition: plugin.h:73
Definition: service_my_plugin_log.h:45
Definition: service_my_plugin_log.h:44
Definition: service_my_plugin_log.h:43
plugin_log_level
Definition: service_my_plugin_log.h:42