NCBI C++ ToolKit
|
#include <config.h>
#include <stdarg.h>
#include <freetds/time.h>
#include <assert.h>
#include <ctype.h>
#include <limits.h>
#include <stdio.h>
#include <freetds/tds.h>
#include <freetds/checks.h>
#include <freetds/thread.h>
Go to the source code of this file.
Go to the SVN repository for this file.
Macros | |
#define | BYTES_PER_LINE 16 |
#define | tdsdump_dump_buf TDSDUMP_BUF_FAST |
#define | tdsdump_log TDSDUMP_LOG_FAST |
Functions | |
static FILE * | tdsdump_append (void) |
void | tdsdump_off (void) |
Temporarily turn off logging. More... | |
void | tdsdump_on (void) |
Turn logging back on. More... | |
int | tdsdump_state (void) |
Get the logging state. More... | |
int | tdsdump_isopen () |
int | tdsdump_open (const char *filename) |
Create and truncate a human readable dump file for the TDS traffic. More... | |
void | tdsdump_close (void) |
Close the TDS dump log file. More... | |
static void | tdsdump_start (FILE *file, const char *fname, int line) |
void | tdsdump_do_dump_buf (const char *file, unsigned int level_line, const char *msg, const void *buf, size_t length) |
Dump the contents of data into the log file in a human readable format. More... | |
void | tdsdump_do_log (const char *file, unsigned int level_line, const char *fmt,...) |
Write a message to the debug log. More... | |
void | tdsdump_col (const TDSCOLUMN *col) |
Write a column value to the debug log. More... | |
Variables | |
int | tds_debug_flags = TDS_DBGFLAG_ALL | TDS_DBGFLAG_SOURCE |
int | tds_g_append_mode = 0 |
static char * | g_dump_filename = NULL |
int | tds_write_dump = 0 |
Tell if TDS debug logging is turned on or off. More... | |
int | tdsdump_elided |
static FILE * | g_dumpfile = NULL |
#define BYTES_PER_LINE 16 |
#define tdsdump_dump_buf TDSDUMP_BUF_FAST |
#define tdsdump_log TDSDUMP_LOG_FAST |
|
static |
Definition at line 189 of file log.c.
References g_dump_filename, NULL, and util::strcmp().
Referenced by tdsdump_do_dump_buf(), tdsdump_do_log(), and tdsdump_open().
void tdsdump_close | ( | void | ) |
Close the TDS dump log file.
Definition at line 207 of file log.c.
References g_dump_filename, g_dump_mutex, g_dumpfile, NULL, tds_mutex_lock, tds_mutex_unlock, tds_write_dump, and TDS_ZERO_FREE.
Write a column value to the debug log.
col | column to dump |
Definition at line 424 of file log.c.
References assert, tds_column::column_cur_size, tds_column::column_data, tds_column::column_size, tds_column::column_type, data, free(), SYBCHAR, SYBFLT8, SYBINT1, SYBINT2, SYBINT4, SYBREAL, SYBVARCHAR, TDS_DBG_FUNC, tds_get_conversion_type, tds_new0, tds_prtype, tdsdump_log, type, and type_name().
void tdsdump_do_dump_buf | ( | const char * | file, |
unsigned int | level_line, | ||
const char * | msg, | ||
const void * | buf, | ||
size_t | length | ||
) |
Dump the contents of data into the log file in a human readable format.
file | source file name |
level_line | line and level combined. This and file are automatically computed by TDS_DBG_* macros. |
msg | message to print before dump |
buf | buffer to dump |
length | number of bytes in the buffer |
Definition at line 270 of file log.c.
References buf, BYTES_PER_LINE, data, file, g_dump_filename, g_dump_mutex, g_dumpfile, i, isprint(), line_buf, NULL, tds_debug_flags, tds_g_append_mode, tds_mutex_lock, tds_mutex_unlock, tds_write_dump, tdsdump_append(), tdsdump_elided, and tdsdump_start().
Write a message to the debug log.
file | name of the log file |
level_line | kind of detail to be included |
fmt | printf-like format string |
Definition at line 370 of file log.c.
References file, g_dump_filename, g_dump_mutex, g_dumpfile, NULL, tds_debug_flags, tds_g_append_mode, tds_mutex_lock, tds_mutex_unlock, tds_write_dump, tdsdump_append(), and tdsdump_start().
int tdsdump_isopen | ( | void | ) |
Definition at line 111 of file log.c.
References g_dump_filename, and g_dumpfile.
Referenced by tdsdump_on().
void tdsdump_off | ( | void | ) |
Temporarily turn off logging.
Definition at line 81 of file log.c.
References g_dump_mutex, tds_mutex_lock, tds_mutex_unlock, and tds_write_dump.
void tdsdump_on | ( | void | ) |
Turn logging back on.
You must call tdsdump_open() before calling this routine.
Definition at line 93 of file log.c.
References g_dump_mutex, tds_mutex_lock, tds_mutex_unlock, tds_write_dump, and tdsdump_isopen().
Create and truncate a human readable dump file for the TDS traffic.
The name of the file is specified by the filename parameter. If that is given as NULL or an empty string, any existing log file will be closed.
Definition at line 126 of file log.c.
References g_dump_filename, g_dump_mutex, g_dumpfile, NULL, result, util::strcmp(), strdup, t, TDS_DBG_INFO1, tds_debug_flags, tds_g_append_mode, tds_localtime_r, tds_mutex_lock, tds_mutex_unlock, tds_write_dump, TDS_ZERO_FREE, tdsdump_append(), tdsdump_log, and VERSION.
Definition at line 220 of file log.c.
References buf, file, TDS_DBGFLAG_PID, TDS_DBGFLAG_SOURCE, TDS_DBGFLAG_TIME, tds_debug_flags, and tds_timestamp_str.
Referenced by tdsdump_do_dump_buf(), and tdsdump_do_log().
int tdsdump_state | ( | void | ) |
|
static |
Definition at line 55 of file log.c.
Referenced by tdsdump_append(), tdsdump_close(), tdsdump_do_dump_buf(), tdsdump_do_log(), tdsdump_isopen(), and tdsdump_open().
|
static |
Definition at line 62 of file log.c.
Referenced by tdsdump_close(), tdsdump_do_dump_buf(), tdsdump_do_log(), tdsdump_isopen(), and tdsdump_open().
int tds_debug_flags = TDS_DBGFLAG_ALL | TDS_DBGFLAG_SOURCE |
Definition at line 53 of file log.c.
Referenced by tdsdump_do_dump_buf(), tdsdump_do_log(), tdsdump_open(), and tdsdump_start().
int tds_g_append_mode = 0 |
Definition at line 54 of file log.c.
Referenced by tdsdump_do_dump_buf(), tdsdump_do_log(), and tdsdump_open().
int tds_write_dump = 0 |
Tell if TDS debug logging is turned on or off.
Definition at line 57 of file log.c.
Referenced by tdsdump_close(), tdsdump_do_dump_buf(), tdsdump_do_log(), tdsdump_off(), tdsdump_on(), tdsdump_open(), and tdsdump_state().
int tdsdump_elided |
Definition at line 61 of file log.c.
Referenced by tdsdump_do_dump_buf().