summaryrefslogtreecommitdiffstats
path: root/src/spdk/ocf/inc/ocf_logger.h
blob: 343a9759f886049e3c71208d64c9e514684e5be4 (plain)
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
38
39
40
41
42
43
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__ */