Skip to content

Commit 6fb8c49

Browse files
author
ekwongchum
committed
perf(output_file):replace FLB_FALSE as default value for line_append
Signed-off-by: ekwongchum <[email protected]>
1 parent 384553c commit 6fb8c49

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

plugins/out_file/file.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ static int cb_file_init(struct flb_output_instance *ins,
9898
ctx->delimiter = NULL;
9999
ctx->label_delimiter = NULL;
100100
ctx->template = NULL;
101-
ctx->line_append = 0;
101+
ctx->line_append = FLB_FALSE;
102102

103103
ret = flb_output_config_map_set(ins, (void *) ctx);
104104
if (ret == -1) {
@@ -154,13 +154,6 @@ static int cb_file_init(struct flb_output_instance *ins,
154154
ctx->label_delimiter = ret_str;
155155
}
156156

157-
tmp = flb_output_get_property("line_append", ins);
158-
if (tmp) {
159-
if (!strcasecmp(tmp, "true")) {
160-
ctx->line_append = 1;
161-
}
162-
}
163-
164157
/* Set the context */
165158
flb_output_set_context(ins, ctx);
166159

@@ -325,7 +318,7 @@ static int template_output(FILE *fp, struct flb_time *tm, msgpack_object *obj,
325318
if (inbrace) {
326319
fputs(inbrace, fp);
327320
}
328-
if (ctx->line_append == 0){
321+
if (ctx->line_append == FLB_FALSE){
329322
fputs(NEWLINE, fp);
330323
}
331324
return 0;

0 commit comments

Comments
 (0)