diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-07-14 18:53:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-07-14 18:53:09 +0000 |
commit | 3945f3269b3e2763faa1ab22d225ca4dd1856b82 (patch) | |
tree | 7e96ec768baa3807ce3a1076a74037a287f4caa8 /src/nvme/log.h | |
parent | Initial commit. (diff) | |
download | libnvme-3945f3269b3e2763faa1ab22d225ca4dd1856b82.tar.xz libnvme-3945f3269b3e2763faa1ab22d225ca4dd1856b82.zip |
Adding upstream version 1.0.upstream/1.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/nvme/log.h')
-rw-r--r-- | src/nvme/log.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/nvme/log.h b/src/nvme/log.h new file mode 100644 index 0000000..1cf797a --- /dev/null +++ b/src/nvme/log.h @@ -0,0 +1,38 @@ +// SPDX-License-Identifier: LGPL-2.1-or-later +/* + * Copyright (c) 2021 Martin Wilck, SUSE LLC + */ +#ifndef _LOG_H +#define _LOG_H + +#include <stdbool.h> +#include <syslog.h> + +/* for nvme_root_t */ +#include "tree.h" + +#ifndef MAX_LOGLEVEL +# define MAX_LOGLEVEL LOG_DEBUG +#endif +#ifndef DEFAULT_LOGLEVEL +# define DEFAULT_LOGLEVEL LOG_NOTICE +#endif + +/** + * DOC: log.h + * + * logging functions + */ + +/** + * nvme_init_logging() - Initialize logging + * @r: nvme_root_t context + * @lvl: Logging level to set + * @log_pid: Boolean to enable logging of the PID + * @log_tstamp: Boolean to enable logging of the timestamp + * + * Sets the default logging variables for the library. + */ +void nvme_init_logging(nvme_root_t r, int lvl, bool log_pid, bool log_tstamp); + +#endif /* _LOG_H */ |