MySQL 9.1.0
Source Code Documentation
service_my_plugin_log.h
Go to the documentation of this file.
1/* Copyright (c) 2011, 2024, 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 designed to work 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 either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24/**
25 @file include/mysql/service_my_plugin_log.h
26 This service provides functions to report error conditions and log to
27 mysql error log.
28*/
29
30#ifndef MYSQL_SERVICE_MY_PLUGIN_LOG_INCLUDED
31#define MYSQL_SERVICE_MY_PLUGIN_LOG_INCLUDED
32
33#ifndef MYSQL_ABI_CHECK
34#include <stdarg.h>
35
36#include "mysql/plugin.h"
37#endif
38
39/* keep in sync with the loglevel enum in my_sys.h */
44};
45
46/**
47 @ingroup group_ext_plugin_services
48
49 Enables plugins to log messages into the server's error log.
50*/
51extern "C" struct my_plugin_log_service {
52 /** Write a message to the log */
54 const char *, ...)
55 MY_ATTRIBUTE((format(printf, 3, 4)));
57
58#ifdef MYSQL_DYNAMIC_PLUGIN
59
60#define my_plugin_log_message my_plugin_log_service->my_plugin_log_message
61
62#else
63
65 const char *format, ...)
66 MY_ATTRIBUTE((format(printf, 3, 4)));
67
68#endif
69
70#endif
struct my_plugin_log_service * my_plugin_log_service
void * MYSQL_PLUGIN
Definition: plugin.h:82
plugin_log_level
Definition: service_my_plugin_log.h:40
@ MY_ERROR_LEVEL
Definition: service_my_plugin_log.h:41
@ MY_WARNING_LEVEL
Definition: service_my_plugin_log.h:42
@ MY_INFORMATION_LEVEL
Definition: service_my_plugin_log.h:43
int my_plugin_log_message(MYSQL_PLUGIN *plugin, enum plugin_log_level level, const char *format,...)
Definition: log.cc:2339
Enables plugins to log messages into the server's error log.
Definition: service_my_plugin_log.h:51
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:53