1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

mysql-5.5.18 merge

This commit is contained in:
Sergei Golubchik
2011-11-03 19:17:05 +01:00
1160 changed files with 12821 additions and 6204 deletions

View File

@@ -16,36 +16,32 @@
#include <my_global.h>
#include "common.h"
/**
This option is set in win_auth_handshake_client() function
in handshake_client.cc.
Values:
0 - no logging
1 - log error/warning/info messages
2 - also log debug messages
Note: No error or debug messages are logged in production code
(see logging macros in common.h).
*/
int opt_auth_win_client_log= 0;
// Client-side logging function
void error_log_vprint(error_log_level::type level,
const char *fmt, va_list args)
{
if (0 == opt_auth_win_client_log)
return;
const char *level_string= "";
int log_level= get_log_level();
switch (level)
{
case error_log_level::INFO: level_string= "Note"; break;
case error_log_level::WARNING: level_string= "Warning"; break;
case error_log_level::ERROR: level_string= "ERROR"; break;
case error_log_level::INFO:
if (3 > log_level)
return;
level_string= "Note";
break;
case error_log_level::WARNING:
if (2 > log_level)
return;
level_string= "Warning";
break;
case error_log_level::ERROR:
if (1 > log_level)
return;
level_string= "ERROR";
break;
}
fprintf(stderr, "Windows Authentication Plugin %s: ", level_string);
@@ -53,3 +49,17 @@ void error_log_vprint(error_log_level::type level,
fputc('\n', stderr);
fflush(stderr);
}
// Trivial implementation of log-level setting storage.
void set_log_level(unsigned int level)
{
opt_auth_win_log_level= level;
}
unsigned int get_log_level(void)
{
return opt_auth_win_log_level;
}