-
Notifications
You must be signed in to change notification settings - Fork 709
Expand file tree
/
Copy pathlogging.h
More file actions
37 lines (27 loc) · 923 Bytes
/
logging.h
File metadata and controls
37 lines (27 loc) · 923 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/* SPDX-License-Identifier: GPL-2.0-or-later */
#ifndef DEBUG_H_
#define DEBUG_H_
#include <stdbool.h>
#include <nvme/lib.h>
#define print_info(...) \
do { \
if (is_printable_at_level(LIBNVME_LOG_INFO)) \
printf(__VA_ARGS__); \
} while (false)
#define print_debug(...) \
do { \
if (is_printable_at_level(LIBNVME_LOG_DEBUG)) \
printf(__VA_ARGS__); \
} while (false)
extern int log_level;
struct libnvme_transport_handle;
struct libnvme_passthru_cmd;
void *nvme_submit_entry(struct libnvme_transport_handle *hdl,
struct libnvme_passthru_cmd *cmd);
void nvme_submit_exit(struct libnvme_transport_handle *hdl,
struct libnvme_passthru_cmd *cmd, int err, void *user_data);
bool nvme_decide_retry(struct libnvme_transport_handle *hdl,
struct libnvme_passthru_cmd *cmd, int err);
bool is_printable_at_level(int level);
int map_log_level(int verbose, bool quiet);
#endif // DEBUG_H_