MySQL 8.3.0
Source Code Documentation
service_my_plugin_log.h
Go to the documentation of this file.
1/* Copyright (c) 2011, 2023, 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
35#include "mysql/plugin.h"
36#endif
37
38/* keep in sync with the loglevel enum in my_sys.h */
43};
44
45/**
46 @ingroup group_ext_plugin_services
47
48 Enables plugins to log messages into the server's error log.
49*/
50extern "C" struct my_plugin_log_service {
51 /** Write a message to the log */
53 const char *, ...)
54 MY_ATTRIBUTE((format(printf, 3, 4)));
56
57#ifdef MYSQL_DYNAMIC_PLUGIN
58
59#define my_plugin_log_message my_plugin_log_service->my_plugin_log_message
60
61#else
62
64 const char *format, ...)
65 MY_ATTRIBUTE((format(printf, 3, 4)));
66
67#endif
68
69#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:39
@ MY_ERROR_LEVEL
Definition: service_my_plugin_log.h:40
@ MY_WARNING_LEVEL
Definition: service_my_plugin_log.h:41
@ MY_INFORMATION_LEVEL
Definition: service_my_plugin_log.h:42
int my_plugin_log_message(MYSQL_PLUGIN *plugin, enum plugin_log_level level, const char *format,...)
Definition: log.cc:2334
Enables plugins to log messages into the server's error log.
Definition: service_my_plugin_log.h:50
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:52