diff options
author | Alexey Botchkov <holyfoot@askmonty.org> | 2012-03-14 00:55:56 +0400 |
---|---|---|
committer | Alexey Botchkov <holyfoot@askmonty.org> | 2012-03-14 00:55:56 +0400 |
commit | 07a82c58a7306bd8ef889dd912cdc437a9f83a89 (patch) | |
tree | edd7edc02e96ad32d8f7d8d5137db548562be16e /strings/my_vsnprintf.c | |
parent | 92f31d8070738206c5b64d3ab5cc9a0cb05c56fa (diff) | |
download | mariadb-git-07a82c58a7306bd8ef889dd912cdc437a9f83a89.tar.gz |
MDEV-15 Log all SQL errors.
Added the logger service that provides us with the rotating logs.
The plugin SQL_ERROR_LOG added. It logs the errors using the 'logger service'
for the rotating log files.
the example record from the log:
2012-03-09 15:07:29 root[root] @ localhost [] ERROR 1146: Table 'test.xyz' doesn't exist : select * from test.xyz
Diffstat (limited to 'strings/my_vsnprintf.c')
-rw-r--r-- | strings/my_vsnprintf.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/strings/my_vsnprintf.c b/strings/my_vsnprintf.c index 8d8c078849c..64c37ca0537 100644 --- a/strings/my_vsnprintf.c +++ b/strings/my_vsnprintf.c @@ -678,3 +678,22 @@ size_t my_snprintf(char* to, size_t n, const char* fmt, ...) va_end(args); return result; } + + +/** + Writes output to the stream according to a format string. + + @param stream file to write to + @param format string format + @param args list of parameters + + @retval + number of the characters written. +*/ + +int my_vfprintf(FILE *stream, const char* format, va_list args) +{ + char cvtbuf[1024]; + (void) my_vsnprintf(cvtbuf, sizeof(cvtbuf), format, args); + return fprintf(stream, "%s\n", cvtbuf); +} |