KubOS
|
KubOS-Core 0.1.0
Main Page
Modules
Files
File List
Globals
kubos-core
k_log.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2015 Kaspar Schleiser <
[email protected]
>
3
*
4
* This file is subject to the terms and conditions of the GNU Lesser
5
* General Public License v2.1. See the file LICENSE in the top level
6
* directory for more details.
7
*/
8
36
#ifndef LOG_H
37
#define LOG_H
38
39
#ifdef __cplusplus
40
extern
"C"
{
41
#endif
42
55
enum
{
56
LOG_NONE
,
57
LOG_ERROR
,
60
LOG_WARNING
,
62
LOG_INFO
,
65
LOG_DEBUG
,
67
LOG_ALL
68
};
69
70
#ifndef LOG_LEVEL
71
74
#define LOG_LEVEL LOG_INFO
75
#endif
76
80
#define LOG(level, ...) if (level <= LOG_LEVEL) log_write(level, __VA_ARGS__)
81
86
#define LOG_ERROR(...) LOG(LOG_ERROR, __VA_ARGS__)
87
#define LOG_WARNING(...) LOG(LOG_WARNING, __VA_ARGS__)
88
#define LOG_INFO(...) LOG(LOG_INFO, __VA_ARGS__)
89
#define LOG_DEBUG(...) LOG(LOG_DEBUG, __VA_ARGS__)
90
92
#ifdef MODULE_LOG
93
#include "kubos-core/common/log_module.h"
94
#else
95
#include <stdio.h>
96
100
#define log_write(level, ...) printf(__VA_ARGS__)
101
#endif
102
103
#ifdef __cplusplus
104
}
105
#endif
106
107
#endif
/* LOG_H */
108
LOG_NONE
Lowest log level, will output nothing.
Definition:
k_log.h:56
LOG_WARNING
#define LOG_WARNING(...)
Definition:
k_log.h:87
LOG_ERROR
#define LOG_ERROR(...)
logging convenience defines
Definition:
k_log.h:86
LOG_INFO
#define LOG_INFO(...)
Definition:
k_log.h:88
LOG_DEBUG
#define LOG_DEBUG(...)
Definition:
k_log.h:89
LOG_ALL
print everything
Definition:
k_log.h:67
Generated by
1.8.11