MCPcopy Index your code
hub / github.com/F-Stack/f-stack / ff_log_open_set

Function ff_log_open_set

lib/ff_log.c:47–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45static char ff_log_filename[FF_LOG_FILENAME_LEN];
46
47int
48ff_log_open_set(void)
49{
50 snprintf(ff_log_filename, sizeof(ff_log_filename) - 1, "%s%u.log",
51 ff_global_cfg.log.dir, ff_global_cfg.dpdk.proc_id);
52 ff_global_cfg.log.f = fopen(ff_log_filename, "a+");
53 if (ff_global_cfg.log.f == NULL) {
54 ff_log(FF_LOG_WARNING, FF_LOGTYPE_FSTACK_LIB,
55 "fopen log file %s failed, errno:%d, %s\n",
56 ff_log_filename, errno, strerror(errno));
57 return -1;
58 }
59
60 ff_log_reset_stream(ff_global_cfg.log.f);
61 ff_log_set_level(FF_LOGTYPE_FSTACK_LIB, ff_global_cfg.log.level);
62 ff_log_set_level(FF_LOGTYPE_FSTACK_FREEBSD, ff_global_cfg.log.level);
63
64 return 0;
65}
66
67void
68ff_log_close(void)

Callers 1

ff_dpdk_initFunction · 0.85

Calls 4

snprintfFunction · 0.85
ff_logFunction · 0.85
ff_log_reset_streamFunction · 0.85
ff_log_set_levelFunction · 0.85

Tested by

no test coverage detected