int easysql_set_log_file(char const *file)
Changes a file to which logging information is written. May be ``stderr'' (messages are directed to standart error stream), ``none'' (no logging is permitted) or a path to file - relative to EasySQL home in case of no leading slash or to root directory otherwise. Default value is inherited from global configuration.
Returns `true' (non-zero) in case of success (may not fall in current version).
char const *easysql_get_log_file()
Returns a path to currently used log file, `stderr' in case of logging to standart error stream or `none' if logging is completely disabled.
char const *easysql_reopen_log()
Closes and reopens log file (if it is not an `stderr' stream). Useful as a reaction to `kill -hup' or something similar. Allows renaming/chopping/deleting of log file.
void easysql_set_log_level(unsigned level)
Sets level of logging to the given value. Value may be combined by binary OR operator from following codes:
SQL queries and their results;
driver loader, calling, stubs etc;
driver's internal logging - what to log depends on exact driver;
C language stubs logging;
miscellaneous internal functions - memory allocating, logging etc.
no logging allowed at all, even error messages are skipped (same effect may be achieved by setting log file name to `none');
only errors are logged, this is the default;
any and all messages and warnings are logged.
An example:
int main() { easysql_set_log_file("/tmp/driver-debug"); easysql_set_log_level(D_IDRV|D_L4); ... } |
unsigned easysql_get_log_level()
Return currently used log level. Usually used for temporary changes of a structure like this:
... unsigned level=easysql_get_log_level(); // Saving current value easysql_set_log_level(D_ALL); ... // Some vital actions easysql_set_log_level(level); // Restoring from saved value ... |
int easysql_set_log_flush(int flag)
`Flag' is a boolean value. To force EasySQL to flush every line of log output set it to non-zero value -- very useful if your program locks up and you see nothing in the log because of buffering.
The default is buffered output and no forced flush.