Repository navigation
Expand file tree
/
Copy pathlog.h
More file actions
66 lines (54 loc) · 1.95 KB
/
Copy pathlog.h
File metadata and controls
66 lines (54 loc) · 1.95 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
55
56
57
58
59
60
61
62
63
64
65
66
/***************************************************************************
* Project : shakti devt board
* Name of the file : log.h
* Brief Description of file : Header file for logger.
* Name of Author : Abhinav Ramnath
* Email ID : abhinavramnath13@gmail.com
Copyright (C) 2019 IIT Madras. All rights reserved.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
***************************************************************************/
/**
* @file log.h
* @brief Header file for logger.
* @details This file is used for logging. There are 6 levels of logging.
Level 0 is the most critical. Usually system stops after level 0 logging.
Level 3 is the default level of logging.
*/
#ifndef LOG_H
#define LOG_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdarg.h>
#include"secure_iot.h"
#ifndef LOG_LEVEL
#define LOG_LEVEL 2
#endif
// Log Levels
#define DEBUG 5
#define TRACE 4
#define INFO 3
#define WARN 2
#define ERROR 1
#define FATAL 0
extern void vprintfmt(void (*putch)(int, void**), void **putdat, const char *fmt, va_list ap);
//function prototype
void log_trace(const char*fmt, ...);
void log_info(const char*fmt, ...);
void log_debug(const char*fmt, ...);
void log_warn(const char*fmt, ...);
void log_error(const char*fmt, ...);
void log_fatal(const char*fmt, ...);
#ifdef __cplusplus
}
#endif //__cplusplus
#endif // LOG_H