@@ -71,10 +71,10 @@ struct log_info {
71
71
static void add_skipped (struct log_info * info )
72
72
{
73
73
if (info -> num_skipped ) {
74
- json_array_start (info -> response , NULL );
74
+ json_object_start (info -> response , NULL );
75
75
json_add_string (info -> response , "type" , "SKIPPED" );
76
76
json_add_num (info -> response , "num_skipped" , info -> num_skipped );
77
- json_array_end (info -> response );
77
+ json_object_end (info -> response );
78
78
info -> num_skipped = 0 ;
79
79
}
80
80
}
@@ -106,7 +106,7 @@ static void log_to_json(unsigned int skipped,
106
106
107
107
add_skipped (info );
108
108
109
- json_array_start (info -> response , NULL );
109
+ json_object_start (info -> response , NULL );
110
110
json_add_string (info -> response , "type" ,
111
111
level == LOG_BROKEN ? "BROKEN"
112
112
: level == LOG_UNUSUAL ? "UNUSUAL"
@@ -126,7 +126,7 @@ static void log_to_json(unsigned int skipped,
126
126
} else
127
127
json_add_string (info -> response , "log" , log );
128
128
129
- json_array_end (info -> response );
129
+ json_object_end (info -> response );
130
130
}
131
131
132
132
static void json_getlog (struct command * cmd ,
@@ -160,9 +160,9 @@ static void json_getlog(struct command *cmd,
160
160
json_add_time (info .response , "creation_time" , log_init_time (lr )-> ts );
161
161
json_add_num (info .response , "bytes_used" , (unsigned int )log_used (lr ));
162
162
json_add_num (info .response , "bytes_max" , (unsigned int )log_max_mem (lr ));
163
- json_object_start (info .response , "log" );
163
+ json_array_start (info .response , "log" );
164
164
log_each_line (lr , log_to_json , & info );
165
- json_object_end (info .response );
165
+ json_array_end (info .response );
166
166
json_object_end (info .response );
167
167
command_success (cmd , info .response );
168
168
}
0 commit comments