/
githubmirror
/
nvme-cli
Обзор
Документация
Войти
/
githubmirror
/
nvme-cli
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v3.0-a.1
logging.h
35 строк
860 B
Nate Thornton
logging: suppress logging except during normal output
02 янв 2026, 20:02
02 янв 2026, 20:02
920ae83
Код
Авторство
О чём код?
/* SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef DEBUG_H_ #define DEBUG_H_ #include <stdbool.h> #define print_info(...) \ do { \ if (is_printable_at_level(LOG_INFO)) \ printf(__VA_ARGS__); \ } while (false) #define print_debug(...) \ do { \ if (is_printable_at_level(LOG_DEBUG)) \ printf(__VA_ARGS__); \ } while (false) extern int log_level; struct nvme_transport_handle; struct nvme_passthru_cmd; void *nvme_submit_entry(struct nvme_transport_handle *hdl, struct nvme_passthru_cmd *cmd); void nvme_submit_exit(struct nvme_transport_handle *hdl, struct nvme_passthru_cmd *cmd, int err, void *user_data); bool nvme_decide_retry(struct nvme_transport_handle *hdl, struct nvme_passthru_cmd *cmd, int err); bool is_printable_at_level(int level); int map_log_level(int verbose, bool quiet); #endif // DEBUG_H_