static void api_list_dir_status_header(UAContext *ua)
{
+ alist tlist(10, not_owned_by_alist);
OutputWriter wt(ua->api_opts);
wt.start_group("header");
wt.get_output(
OT_PLUGINS,"plugins", b_plugin_list,
OT_INT32, "fips", crypto_get_fips(),
OT_STRING, "crypto", crypto_get_version(),
+ OT_INT64, "debug", debug_level,
+ OT_INT, "trace", get_trace(),
+ OT_ALIST_STR, "tags", debug_get_tags_list(&tlist, debug_level_tags),
OT_END);
ua->send_msg("%s", wt.end_group());
char *p;
char buf[300];
const char *cipher=NULL, *digest=NULL;
+ alist tlist(10, not_owned_by_alist);
OutputWriter wt(sp->api_opts);
*buf = 0;
OT_STRING, "winver", buf,
OT_INT64, "debug", debug_level,
OT_INT, "trace", get_trace(),
+ OT_ALIST_STR, "tags", debug_get_tags_list(&tlist, debug_level_tags),
OT_INT64, "bwlimit", me->max_bandwidth_per_job,
OT_PLUGINS, "plugins", b_plugin_list,
OT_INT, "pkiencryption", (int)me->pki_encrypt,
return false;
}
+/* Convert back tag bits to a string */
+char *debug_get_tags(POOLMEM **options, int64_t current_level)
+{
+ bool first=true;
+
+ pm_strcpy(options, "");
+ for (int i = 0; debug_tags[i].tag; i++) {
+ if ((debug_tags[i].bit & current_level) == debug_tags[i].bit) {
+ if (!first) {
+ pm_strcat(options, ",");
+ }
+ pm_strcat(options, debug_tags[i].tag);
+ first=false;
+ }
+ }
+ return *options;
+}
+
+/* Convert back tag bits to a list (not_owned_by_alist) */
+alist *debug_get_tags_list(alist *options, int64_t current_level)
+{
+ for (int i = 0; debug_tags[i].tag; i++) {
+ if ((debug_tags[i].bit & current_level) == debug_tags[i].bit) {
+ options->append((char *)debug_tags[i].tag);
+ }
+ }
+ return options;
+}
+
bool debug_parse_tags(const char *options, int64_t *current_level)
{
bool operation; /* + => true, - false */
const char *debug_get_tag(uint32_t pos, const char **desc);
bool debug_find_tag(const char *tagname, bool add, int64_t *current_level);
bool debug_parse_tags(const char *options, int64_t *current_level);
+alist *debug_get_tags_list(alist *options, int64_t current_level);
+char *debug_get_tags(POOLMEM **options, int64_t current_level);
class MSGS;
MSGS *get_current_MSGS(JCR *jcr);
{
char *p;
alist drivers(10, not_owned_by_alist);
+ alist tlist(10, not_owned_by_alist);
OutputWriter wt(sp->api_opts);
sd_list_loaded_drivers(&drivers);
OT_ALIST_STR, "drivers", &drivers,
OT_INT32, "fips", (int32_t)crypto_get_fips(),
OT_STRING, "openssl", crypto_get_version(),
+ OT_INT64, "debug", debug_level,
+ OT_INT, "trace", get_trace(),
+ OT_ALIST_STR, "tags", debug_get_tags_list(&tlist, debug_level_tags),
OT_END);
p = wt.end_group();
sendit(p, strlen(p), sp);