-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
llama.cpp: add logging example/exploration code
- Loading branch information
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#include "log.h" | ||
#include <cstdio> | ||
|
||
int main(int argc, char** argv) { | ||
LOG("logging example\n"); | ||
|
||
// Set log verbosity threshold to 3 (GGML_LOG_LEVEL_ERROR) | ||
common_log_set_verbosity_thold(3); | ||
LOG("\n"); | ||
|
||
LOG("common_log_set_verbosity_thold: %d \n", common_log_verbosity_thold); | ||
LOG("\n"); | ||
|
||
LOG_INF("LOG_FIN verbosity does not matter\n"); | ||
LOG_ERR("LOG_ERR verbosity does not matter\n"); | ||
LOG("\n"); | ||
|
||
LOG("Log macros with verbosity:\n"); | ||
LOG_INFV(GGML_LOG_LEVEL_ERROR, "LOG_INFV verbosity error info\n"); | ||
LOG_INFV(GGML_LOG_LEVEL_NONE, "LOG_INFV verbosisty none info\n"); | ||
LOG_ERRV(GGML_LOG_LEVEL_ERROR, "LOG_INFV verbosity error error\n"); | ||
|
||
LOG_ERRV(4, "LOG_ERRV will not be printed if verbosity is 4! \n"); | ||
|
||
return 0; | ||
} |