[Previous] [Next] [Contents]

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:

An example:

int main()
{ easysql_set_log_file("/tmp/driver-debug");

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
...                                     // 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.

[Previous] [Next] [Contents]