Repository: ggerganov/llama.cpp
File: common/arg.cpp (C++)

Code before:
        }
    ).set_examples({LLAMA_EXAMPLE_BENCH}));
    add_opt(common_arg(
        {"--log-disable"},
        "Log disable",
        [](common_params &) {
            common_log_pause(common_log_main());
        }
    ));
    add_opt(common_arg(
        {"--log-file"}, "FNAME",
        "Log to file",
        [](common_params &, const std::string & value) {
            common_log_set_file(common_log_main(), value.c_str());
        }
    ));
    add_opt(common_arg({ "--log-colors" }, "[always|never|auto]",
                       "Enable colored logging ('on', 'off', or 'auto', default: 'auto')\n"
                       "'auto' enables colors when output is to a terminal",
                       [](common_params &, const std::string & value) {
                           if (is_truthy(value)) {
                               common_log_set_colors(common_log_main(), true);
                           } else if (is_falsey(value)) {
                               common_log_set_colors(common_log_main(), false);
                           } else if (is_autoy(value)) {
                               common_log_set_colors_auto(common_log_main());
                           } else {
                               throw std::invalid_argument(
                                   string_format("error: unkown value for --log-colors: '%s'\n", value.c_str()));
                           }
                       })
                .set_env("LLAMA_LOG_COLORS"));
    add_opt(common_arg(
        {"-v", "--verbose", "--log-verbose"},
        "Set verbosity level to infinity (i.e. log all messages, useful for debugging)",
        [](common_params & params) {
            params.verbosity = INT_MAX;
            common_log_set_verbosity_thold(INT_MAX);
        }
    ));
    add_opt(common_arg(
        {"--offline"},
        "Offline mode: forces use of cache, prevents network access",
        [](common_params & params) {
            params.offline = true;
        }
    ).set_env("LLAMA_OFFLINE"));
    add_opt(common_arg(
        {"-lv", "--verbosity", "--log-verbosity"}, "N",
        "Set the verbosity threshold. Messages with a higher verbosity will be ignored.",
        [](common_params & params, int value) {

Review comment (suggestion):
```suggestion
                               common_log_set_colors(common_log_main(), common_log_should_use_colors_auto());
```

The function `common_log_set_colors_auto` is extremely simple and only used once so I think it should either be removed or the bool replaced with an enum for on/off/auto.

Code after:
    ).set_examples({LLAMA_EXAMPLE_BENCH}));
    add_opt(common_arg(
        {"--log-disable"},
        "Log disable",
        [](common_params &) {
            common_log_pause(common_log_main());
        }
    ));
    add_opt(common_arg(
        {"--log-file"}, "FNAME",
        "Log to file",
        [](common_params &, const std::string & value) {
            common_log_set_file(common_log_main(), value.c_str());
        }
    ));
    add_opt(common_arg({ "--log-colors" }, "[on|off|auto]",
                       "Set colored logging ('on', 'off', or 'auto', default: 'auto')\n"
                       "'auto' enables colors when output is to a terminal",
                       [](common_params &, const std::string & value) {
                           if (is_truthy(value)) {
                               common_log_set_colors(common_log_main(), LOG_COLORS_ENABLED);
                           } else if (is_falsey(value)) {
                               common_log_set_colors(common_log_main(), LOG_COLORS_DISABLED);
                           } else if (is_autoy(value)) {
                               common_log_set_colors(common_log_main(), LOG_COLORS_AUTO);
                           } else {
                               throw std::invalid_argument(
                                   string_format("error: unkown value for --log-colors: '%s'\n", value.c_str()));
                           }
                       }).set_env("LLAMA_LOG_COLORS"));
    add_opt(common_arg(
        {"-v", "--verbose", "--log-verbose"},
        "Set verbosity level to infinity (i.e. log all messages, useful for debugging)",
        [](common_params & params) {
            params.verbosity = INT_MAX;
            common_log_set_verbosity_thold(INT_MAX);
        }
    ));
    add_opt(common_arg(
        {"--offline"},
        "Offline mode: forces use of cache, prevents network access",
        [](common_params & params) {
            params.offline = true;
        }
    ).set_env("LLAMA_OFFLINE"));
    add_opt(common_arg(
        {"-lv", "--verbosity", "--log-verbosity"}, "N",
        "Set the verbosity threshold. Messages with a higher verbosity will be ignored.",
        [](common_params & params, int value) {
            params.verbosity = value;
            common_log_set_verbosity_thold(value);