Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions include/fluent-bit/flb_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@ struct flb_config {
int daemon; /* Run as a daemon ? */
flb_pipefd_t shutdown_fd; /* Shutdown FD, 5 seconds */

int verbose; /* Verbose mode (default OFF) */
time_t init_time; /* Time when Fluent Bit started */
int verbose; /* Verbose mode (default OFF) */
int banner; /* Print version banner (default ON) */
time_t init_time; /* Time when Fluent Bit started */

/* Used in library mode */
pthread_t worker; /* worker tid */
Expand Down
1 change: 1 addition & 0 deletions src/flb_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ struct flb_config *flb_config_init()
config->init_time = time(NULL);
config->kernel = flb_kernel_info();
config->verbose = 3;
config->banner = FLB_TRUE;
config->grace = 5;
config->grace_count = 0;
config->grace_input = config->grace / 2;
Expand Down
10 changes: 8 additions & 2 deletions src/fluent-bit.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ static void flb_help(int rc, struct flb_config *config)
print_opt_i("-s, --coro_stack_size", "set coroutines stack size in bytes",
config->coro_stack_size);
print_opt("-q, --quiet", "quiet mode");
print_opt("-B, --no-banner", "Disable printing of version banner");
print_opt("-S, --sosreport", "support report for Enterprise customers");
print_opt("-Y, --enable-hot-reload", "enable for hot reloading");
print_opt("-W, --disable-thread-safety-on-hot-reloading", "disable thread safety on hot reloading");
Expand Down Expand Up @@ -1068,6 +1069,7 @@ static int flb_main_run(int argc, char **argv)
{ "verbose", no_argument , NULL, 'v' },
{ "workdir", required_argument, NULL, 'w' },
{ "quiet", no_argument , NULL, 'q' },
{ "no-banner", no_argument , NULL, 'B' },
{ "help", no_argument , NULL, 'h' },
{ "help-json", no_argument , NULL, 'J' },
{ "coro_stack_size", required_argument, NULL, 's' },
Expand Down Expand Up @@ -1125,7 +1127,7 @@ static int flb_main_run(int argc, char **argv)
/* Parse the command line options */
while ((opt = getopt_long(argc, argv,
"b:c:dDf:C:i:m:M:o:R:r:F:p:e:"
"t:T:l:vw:qVhJL:HP:s:SWYZ",
"t:T:l:vBw:qVhJL:HP:s:SWYZ",
long_opts, NULL)) != -1) {

switch (opt) {
Expand Down Expand Up @@ -1284,6 +1286,9 @@ static int flb_main_run(int argc, char **argv)
case 'v':
config->verbose++;
break;
case 'B':
config->banner = FLB_FALSE;
break;
case 'w':
config->workdir = flb_strdup(optarg);
break;
Expand Down Expand Up @@ -1341,7 +1346,8 @@ static int flb_main_run(int argc, char **argv)

set_log_level_from_env(config);

if (config->verbose != FLB_LOG_OFF) {
/* Show banner only if the configuration explicitly says so */
if (config->verbose != FLB_LOG_OFF && config->banner == FLB_TRUE) {
flb_version_banner();
}
Comment on lines +1349 to 1352
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Update misleading comment.

The logic is correct, but the comment is misleading. It states "only if the configuration explicitly says so", but the banner is actually shown by default unless explicitly disabled via -B or quiet mode (-q).

The comment should reflect that the banner is the default behavior, not an opt-in feature.

🔎 Suggested comment correction
-    /* Show banner only if the configuration explicitly says so */
+    /* Show banner unless disabled via --no-banner or quiet mode */
     if (config->verbose != FLB_LOG_OFF && config->banner == FLB_TRUE) {
         flb_version_banner();
     }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/* Show banner only if the configuration explicitly says so */
if (config->verbose != FLB_LOG_OFF && config->banner == FLB_TRUE) {
flb_version_banner();
}
/* Show banner unless disabled via --no-banner or quiet mode */
if (config->verbose != FLB_LOG_OFF && config->banner == FLB_TRUE) {
flb_version_banner();
}
🤖 Prompt for AI Agents
In src/fluent-bit.c around lines 1349 to 1352, the existing comment "Show banner
only if the configuration explicitly says so" is misleading because the banner
is shown by default unless disabled with -B or quiet mode; update the comment to
state that the banner is displayed by default and will be suppressed only when
config->banner is false or verbose is set to FLB_LOG_OFF (e.g., via -B or -q),
so the comment accurately reflects default behavior and suppression conditions.


Expand Down
Loading