]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
server : add --log-disable to disable logging to file (#4260)
authorZiad Ben Hadj-Alouane <redacted>
Thu, 30 Nov 2023 22:25:49 +0000 (17:25 -0500)
committerGitHub <redacted>
Thu, 30 Nov 2023 22:25:49 +0000 (00:25 +0200)
* * add --log-disable to disable logging to file in the server example

* * typo fix

examples/server/server.cpp

index 5edb3678efe09283eacca729c152f601dc91fcd9..a65344b9207f43ae07fdf764ab70b880a6a54859 100644 (file)
@@ -1961,6 +1961,7 @@ static void server_print_usage(const char *argv0, const gpt_params &params,
     printf("    -spf FNAME, --system-prompt-file FNAME\n");
     printf("                        Set a file to load a system prompt (initial prompt of all slots), this is useful for chat applications.\n");
     printf("  --mmproj MMPROJ_FILE  path to a multimodal projector file for LLaVA.\n");
+    printf("  --log-disable         disables logging to a file.\n");
     printf("\n");
 }
 
@@ -2315,6 +2316,11 @@ static void server_params_parse(int argc, char **argv, server_params &sparams,
             }
             params.mmproj = argv[i];
         }
+        else if (arg == "--log-disable")
+        {
+            log_set_target(stdout);
+            LOG_INFO("logging to file is disabled.", {});
+        }
         else
         {
             fprintf(stderr, "error: unknown argument: %s\n", arg.c_str());