summaryrefslogtreecommitdiffstats
path: root/src/spdk/ocf/inc/ocf_logger.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:54:28 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:54:28 +0000
commite6918187568dbd01842d8d1d2c808ce16a894239 (patch)
tree64f88b554b444a49f656b6c656111a145cbbaa28 /src/spdk/ocf/inc/ocf_logger.h
parentInitial commit. (diff)
downloadceph-e6918187568dbd01842d8d1d2c808ce16a894239.tar.xz
ceph-e6918187568dbd01842d8d1d2c808ce16a894239.zip
Adding upstream version 18.2.2.upstream/18.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/spdk/ocf/inc/ocf_logger.h')
-rw-r--r--src/spdk/ocf/inc/ocf_logger.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/spdk/ocf/inc/ocf_logger.h b/src/spdk/ocf/inc/ocf_logger.h
new file mode 100644
index 000000000..343a9759f
--- /dev/null
+++ b/src/spdk/ocf/inc/ocf_logger.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright(c) 2012-2018 Intel Corporation
+ * SPDX-License-Identifier: BSD-3-Clause-Clear
+ */
+
+#ifndef __OCF_LOGGER_H__
+#define __OCF_LOGGER_H__
+
+/**
+ * @file
+ * @brief Logger API
+ */
+
+#include <ocf/ocf_types.h>
+#include <stdarg.h>
+
+/**
+ * @brief Verbosity levels of context log
+ */
+typedef enum {
+ log_emerg,
+ log_alert,
+ log_crit,
+ log_err,
+ log_warn,
+ log_notice,
+ log_info,
+ log_debug,
+} ocf_logger_lvl_t;
+
+struct ocf_logger_ops {
+ int (*open)(ocf_logger_t logger);
+ void (*close)(ocf_logger_t logger);
+ int (*print)(ocf_logger_t logger, ocf_logger_lvl_t lvl,
+ const char *fmt, va_list args);
+ int (*print_rl)(ocf_logger_t logger, const char *func_name);
+ int (*dump_stack)(ocf_logger_t logger);
+};
+
+void ocf_logger_set_priv(ocf_logger_t logger, void *priv);
+
+void *ocf_logger_get_priv(ocf_logger_t logger);
+
+#endif /* __OCF_LOGGER_H__ */