MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / log_test

Function log_test

common/log.h:464–503  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

462}
463
464inline void log_test()
465{
466 log_disable();
467 LOG("01 Hello World to nobody, because logs are disabled!\n");
468 log_enable();
469 LOG("02 Hello World to default output, which is \"%s\" ( Yaaay, arguments! )!\n", LOG_STRINGIZE(LOG_TARGET));
470 LOG_TEE("03 Hello World to **both** default output and " LOG_TEE_TARGET_STRING "!\n");
471 log_set_target(stderr);
472 LOG("04 Hello World to stderr!\n");
473 LOG_TEE("05 Hello World TEE with double printing to stderr prevented!\n");
474 log_set_target(LOG_DEFAULT_FILE_NAME);
475 LOG("06 Hello World to default log file!\n");
476 log_set_target(stdout);
477 LOG("07 Hello World to stdout!\n");
478 log_set_target(LOG_DEFAULT_FILE_NAME);
479 LOG("08 Hello World to default log file again!\n");
480 log_disable();
481 LOG("09 Hello World _1_ into the void!\n");
482 log_enable();
483 LOG("10 Hello World back from the void ( you should not see _1_ in the log or the output )!\n");
484 log_disable();
485 log_set_target("llama.anotherlog.log");
486 LOG("11 Hello World _2_ to nobody, new target was selected but logs are still disabled!\n");
487 log_enable();
488 LOG("12 Hello World this time in a new file ( you should not see _2_ in the log or the output )?\n");
489 log_set_target("llama.yetanotherlog.log");
490 LOG("13 Hello World this time in yet new file?\n");
491 log_set_target(log_filename_generator("llama_autonamed", "log"));
492 LOG("14 Hello World in log with generated filename!\n");
493#ifdef _MSC_VER
494 LOG_TEE("15 Hello msvc TEE without arguments\n");
495 LOG_TEE("16 Hello msvc TEE with (%d)(%s) arguments\n", 1, "test");
496 LOG_TEELN("17 Hello msvc TEELN without arguments\n");
497 LOG_TEELN("18 Hello msvc TEELN with (%d)(%s) arguments\n", 1, "test");
498 LOG("19 Hello msvc LOG without arguments\n");
499 LOG("20 Hello msvc LOG with (%d)(%s) arguments\n", 1, "test");
500 LOGLN("21 Hello msvc LOGLN without arguments\n");
501 LOGLN("22 Hello msvc LOGLN with (%d)(%s) arguments\n", 1, "test");
502#endif
503}
504
505inline bool log_param_single_parse(const std::string & param)
506{

Callers 1

log_param_single_parseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected