csync: Add option to set and get log verbosity.

This commit is contained in:
Andreas Schneider 2012-10-27 15:43:01 +02:00
parent 890df87d00
commit 95b367dd23
3 changed files with 39 additions and 0 deletions

View File

@ -771,6 +771,24 @@ int csync_set_auth_callback(CSYNC *ctx, csync_auth_callback cb) {
return 0;
}
int csync_set_log_verbosity(CSYNC *ctx, int verbosity) {
if (ctx == NULL || verbosity < 0) {
return -1;
}
ctx->options.log_verbosity = verbosity;
return 0;
}
int csync_get_log_verbosity(CSYNC *ctx) {
if (ctx == NULL) {
return -1;
}
return ctx->options.log_verbosity;
}
int csync_set_log_callback(CSYNC *ctx, csync_log_callback cb) {
if (ctx == NULL || cb == NULL) {
return -1;

View File

@ -325,6 +325,26 @@ csync_auth_callback csync_get_auth_callback(CSYNC *ctx);
*/
int csync_set_auth_callback(CSYNC *ctx, csync_auth_callback cb);
/**
* @brief Set the log verbosity.
*
* @param ctx The csync context.
*
* @param[in] verbosity The log verbosity.
*
* @return 0 on success, < 0 if an error occured.
*/
int csync_set_log_verbosity(CSYNC *ctx, int verbosity);
/**
* @brief Get the log verbosity
*
* @param[in] ctx The csync context to ask for the log verbosity.
*
* @return The log verbosity, -1 on error.
*/
int csync_get_log_verbosity(CSYNC *ctx);
/**
* @brief Get the logging callback set.
*

View File

@ -121,6 +121,7 @@ struct csync_s {
char *config_dir;
bool with_conflict_copys;
bool local_only_mode;
int log_verbosity;
} options;
struct {