mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
csync: Add option to set and get log verbosity.
This commit is contained in:
parent
890df87d00
commit
95b367dd23
18
src/csync.c
18
src/csync.c
@ -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;
|
||||
|
||||
20
src/csync.h
20
src/csync.h
@ -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.
|
||||
*
|
||||
|
||||
@ -121,6 +121,7 @@ struct csync_s {
|
||||
char *config_dir;
|
||||
bool with_conflict_copys;
|
||||
bool local_only_mode;
|
||||
int log_verbosity;
|
||||
} options;
|
||||
|
||||
struct {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user