| 1 |
.. _log.h: |
| 2 |
|
| 3 |
**log.h** |
| 4 |
|
| 5 |
|
| 6 |
logging functions |
| 7 |
|
| 8 |
.. c:function:: void nvme_init_logging (nvme_root_t r, int lvl, bool log_pid, bool log_tstamp) |
| 9 |
|
| 10 |
Initialize logging |
| 11 |
|
| 12 |
**Parameters** |
| 13 |
|
| 14 |
``nvme_root_t r`` |
| 15 |
nvme_root_t context |
| 16 |
|
| 17 |
``int lvl`` |
| 18 |
Logging level to set |
| 19 |
|
| 20 |
``bool log_pid`` |
| 21 |
Boolean to enable logging of the PID |
| 22 |
|
| 23 |
``bool log_tstamp`` |
| 24 |
Boolean to enable logging of the timestamp |
| 25 |
|
| 26 |
**Description** |
| 27 |
|
| 28 |
Sets the default logging variables for the library. |
| 29 |
|
| 30 |
|
| 31 |
.. c:function:: void nvme_init_default_logging (FILE *fp, int lvl, bool log_pid, bool log_tstamp) |
| 32 |
|
| 33 |
Initialize default (fallback) logging |
| 34 |
|
| 35 |
**Parameters** |
| 36 |
|
| 37 |
``FILE *fp`` |
| 38 |
File descriptor for logging messages |
| 39 |
|
| 40 |
``int lvl`` |
| 41 |
Logging level to set |
| 42 |
|
| 43 |
``bool log_pid`` |
| 44 |
Boolean to enable logging of the PID |
| 45 |
|
| 46 |
``bool log_tstamp`` |
| 47 |
Boolean to enable logging of the timestamp |
| 48 |
|
| 49 |
**Description** |
| 50 |
|
| 51 |
Sets the default logging settings for the library in case the root object |
| 52 |
is absent. |
| 53 |
|
| 54 |
|
| 55 |
.. c:function:: int nvme_get_logging_level (nvme_root_t r, bool *log_pid, bool *log_tstamp) |
| 56 |
|
| 57 |
Get current logging level |
| 58 |
|
| 59 |
**Parameters** |
| 60 |
|
| 61 |
``nvme_root_t r`` |
| 62 |
nvme_root_t context |
| 63 |
|
| 64 |
``bool *log_pid`` |
| 65 |
Pointer to store a current value of logging of |
| 66 |
the PID flag at (optional). |
| 67 |
|
| 68 |
``bool *log_tstamp`` |
| 69 |
Pointer to store a current value of logging of |
| 70 |
the timestamp flag at (optional). |
| 71 |
|
| 72 |
**Description** |
| 73 |
|
| 74 |
Retrieves current values of logging variables. |
| 75 |
|
| 76 |
**Return** |
| 77 |
|
| 78 |
current log level value or DEFAULT_LOGLEVEL if not initialized. |
| 79 |
|
| 80 |
|
| 81 |
.. c:function:: void nvme_set_root (nvme_root_t r) |
| 82 |
|
| 83 |
Set nvme_root_t context |
| 84 |
|
| 85 |
**Parameters** |
| 86 |
|
| 87 |
``nvme_root_t r`` |
| 88 |
nvme_root_t context |
| 89 |
|
| 90 |
**Description** |
| 91 |
|
| 92 |
In order to be able to log from code paths where no root object is passed in |
| 93 |
via the arguments use the the default one which can be set via this call. |
| 94 |
When creating a new root object with **nvme_create_root** the global root object |
| 95 |
will be set as well. This means the global root object is always pointing to |
| 96 |
the latest created root object. Note the first **nvme_free_tree** call will reset |
| 97 |
the global root object. |
| 98 |
|
| 99 |
This function is deprecated. Use nvme_init_default_logging or/and |
| 100 |
nvme_init_logging instead. |
| 101 |
|
| 102 |
|
| 103 |
.. c:function:: void nvme_set_debug (bool debug) |
| 104 |
|
| 105 |
Set NVMe command debugging output |
| 106 |
|
| 107 |
**Parameters** |
| 108 |
|
| 109 |
``bool debug`` |
| 110 |
true to enable or false to disable |
| 111 |
|
| 112 |
**Description** |
| 113 |
|
| 114 |
This function is deprecated. Use nvme_init_default_logging instead. |
| 115 |
|
| 116 |
|
| 117 |
.. c:function:: bool nvme_get_debug (void) |
| 118 |
|
| 119 |
Get NVMe command debugging output |
| 120 |
|
| 121 |
**Parameters** |
| 122 |
|
| 123 |
``void`` |
| 124 |
no arguments |
| 125 |
|
| 126 |
**Description** |
| 127 |
|
| 128 |
|
| 129 |
This function is deprecated. Use nvme_get_logging_level instead. |
| 130 |
|
| 131 |
**Return** |
| 132 |
|
| 133 |
false if disabled or true if enabled. |
| 134 |
|
| 135 |
|