@@ -32,9 +32,29 @@ void gpt_log_free (struct gpt_log * log);
3232LOG_ATTRIBUTE_FORMAT (3 , 4 )
3333void gpt_log_add (struct gpt_log * log , enum ggml_log_level level , const char * fmt , ...);
3434
35+ // defaults: file = NULL, colors = false, prefix = false, timestamps = false
36+ //
37+ // regular log output:
38+ //
39+ // ggml_backend_metal_log_allocated_size: allocated buffer, size = 6695.84 MiB, ( 6695.91 / 21845.34)
40+ // llm_load_tensors: ggml ctx size = 0.27 MiB
41+ // llm_load_tensors: offloading 32 repeating layers to GPU
42+ // llm_load_tensors: offloading non-repeating layers to GPU
43+ //
44+ // with prefix = true, timestamps = true, the log output will look like this:
45+ //
46+ // 0.00.035.060 D ggml_backend_metal_log_allocated_size: allocated buffer, size = 6695.84 MiB, ( 6695.91 / 21845.34)
47+ // 0.00.035.064 I llm_load_tensors: ggml ctx size = 0.27 MiB
48+ // 0.00.090.578 I llm_load_tensors: offloading 32 repeating layers to GPU
49+ // 0.00.090.579 I llm_load_tensors: offloading non-repeating layers to GPU
50+ //
51+ // I - info, W - warning, E - error, D - debug
52+ //
53+
3554void gpt_log_set_file (struct gpt_log * log , const char * file ); // not thread-safe
3655void gpt_log_set_colors (struct gpt_log * log , bool colors ); // not thread-safe
37- void gpt_log_set_timestamps (struct gpt_log * log , bool timestamps );
56+ void gpt_log_set_prefix (struct gpt_log * log , bool prefix ); // whether to output prefix to each log
57+ void gpt_log_set_timestamps (struct gpt_log * log , bool timestamps ); // whether to output timestamps in the prefix
3858
3959// helper macros for logging
4060// use these to avoid computing log arguments if the verbosity is lower than the threshold
0 commit comments