-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathlogging.h
More file actions
54 lines (46 loc) · 2.3 KB
/
logging.h
File metadata and controls
54 lines (46 loc) · 2.3 KB
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
45
46
47
48
49
50
51
52
53
54
/******************************************************************************/
/* Copyright 2021 Keyfactor */
/* Licensed under the Apache License, Version 2.0 (the "License"); you may */
/* not use this file except in compliance with the License. You may obtain a */
/* copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless */
/* required by applicable law or agreed to in writing, software distributed */
/* under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES */
/* OR CONDITIONS OF ANY KIND, either express or implied. See the License for */
/* thespecific language governing permissions and limitations under the */
/* License. */
/******************************************************************************/
#ifndef LOGGING_H_
#define LOGGING_H_
#define _POSIX_C_SOURCE 200809L // POSIX.1-2008
#include <stdbool.h>
void log_error(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
void log_warn(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
void log_info(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
void log_verbose(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
void log_debug(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
void log_trace(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
#ifdef __QATESTING__
void log_qa(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
#endif
void log_set_trace(bool param);
void log_set_debug(bool param);
void log_set_verbosity(bool param);
void log_set_info(bool param);
void log_set_warn(bool param);
void log_set_error(bool param);
void log_set_off(bool param);
bool is_log_off(void);
bool is_log_error(void);
bool is_log_warn(void);
bool is_log_info(void);
bool is_log_verbose(void);
bool is_log_debug(void);
bool is_log_trace(void);
bool load_log_buffer(void);
void write_log_file(void);
void free_log_heap(void);
#define LOG_INF __FILE__, __func__, __LINE__
#endif /* LOGGING_H_ */
/******************************************************************************/
/******************************* END OF FILE **********************************/
/******************************************************************************/