diff options
author | Andrew Godfrey <AndrewGodfrey@users.noreply.github.com> | 2023-11-30 13:56:19 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-30 23:56:19 +0200 |
commit | 8efa0f6ebed53c9453e6721da86fb294e5015909 (patch) | |
tree | 9a8cd940f637cd2eda3afd95267e1c902d1c09a3 /examples/main/main.cpp | |
parent | 524907aa768a26cbf83d8e2eb30547e2ee1d1b1a (diff) |
main : pass LOG_TEE callback to llama.cpp log (#4033)
* main : Call llama_log_set to use LOG_TEE
* tabs to spaces
Diffstat (limited to 'examples/main/main.cpp')
-rw-r--r-- | examples/main/main.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/examples/main/main.cpp b/examples/main/main.cpp index 31ec8cad..c5cdfbf2 100644 --- a/examples/main/main.cpp +++ b/examples/main/main.cpp @@ -100,6 +100,12 @@ static void sigint_handler(int signo) { } #endif +static void llama_log_callback_logTee(ggml_log_level level, const char * text, void * user_data) { + (void) level; + (void) user_data; + LOG_TEE("%s", text); +} + int main(int argc, char ** argv) { gpt_params params; g_params = ¶ms; @@ -113,6 +119,7 @@ int main(int argc, char ** argv) { log_set_target(log_filename_generator("main", "log")); LOG_TEE("Log start\n"); log_dump_cmdline(argc, argv); + llama_log_set(llama_log_callback_logTee, nullptr); #endif // LOG_DISABLE_LOGS // TODO: Dump params ? |