mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-20 15:56:21 +00:00
@@ -644,8 +644,9 @@ static struct cmd_t command_defs[] =
|
||||
{ "/log [property] [value]",
|
||||
"-----------------------",
|
||||
"Property may be one of:",
|
||||
"rotate : 'on' or 'off', determines whether the log will be rotated, defaults to 'on'",
|
||||
"maxsize : When log file size exceeds this value and rotate is enabled, it will be automatically be rotated, defaults to 1048580 (1MB)",
|
||||
"rotate : Rotate log, accepts 'on' or 'off', defaults to 'on'.",
|
||||
"maxsize : With rotate enabled, specifies the max log size, defaults to 1048580 (1MB).",
|
||||
"shared : Share logs between all instances, accepts 'on' or 'off', defaults to 'on'.",
|
||||
NULL } } },
|
||||
|
||||
{ "/reconnect",
|
||||
@@ -953,6 +954,7 @@ cmd_init(void)
|
||||
log_ac = autocomplete_new();
|
||||
autocomplete_add(log_ac, "maxsize");
|
||||
autocomplete_add(log_ac, "rotate");
|
||||
autocomplete_add(log_ac, "shared");
|
||||
|
||||
autoaway_ac = autocomplete_new();
|
||||
autocomplete_add(autoaway_ac, "mode");
|
||||
@@ -1687,6 +1689,11 @@ _log_autocomplete(char *input, int *size)
|
||||
if (result != NULL) {
|
||||
return result;
|
||||
}
|
||||
result = autocomplete_param_with_func(input, size, "/log shared",
|
||||
prefs_autocomplete_boolean_choice);
|
||||
if (result != NULL) {
|
||||
return result;
|
||||
}
|
||||
result = autocomplete_param_with_ac(input, size, "/log", log_ac);
|
||||
if (result != NULL) {
|
||||
return result;
|
||||
|
||||
@@ -2304,6 +2304,18 @@ cmd_log(gchar **args, struct cmd_help_t help)
|
||||
}
|
||||
}
|
||||
|
||||
if (strcmp(subcmd, "shared") == 0) {
|
||||
if (value == NULL) {
|
||||
cons_show("Usage: %s", help.usage);
|
||||
return TRUE;
|
||||
} else {
|
||||
gboolean result = _cmd_set_boolean_preference(value, help,
|
||||
"Shared log", PREF_LOG_SHARED);
|
||||
log_reinit();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
cons_show("Usage: %s", help.usage);
|
||||
|
||||
/* TODO: make 'level' subcommand for debug level */
|
||||
|
||||
Reference in New Issue
Block a user