GNU Radio's SATNOGS Package
log.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * gr-satnogs: SatNOGS GNU Radio Out-Of-Tree Module
4  *
5  * Copyright (C) 2016, Libre Space Foundation <http://librespacefoundation.org/>
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef LOG_H_
22 #define LOG_H_
23 
24 
25 #include <stdio.h>
26 #include <errno.h>
27 #include <string.h>
28 #include <satnogs/config.h>
29 #include <sys/syscall.h>
30 
31 
32 #if ENABLE_DEBUG_MSG
33 #define LOG_INFO(M, ...) \
34  fprintf(stderr, "[INFO]: " M " \n", ##__VA_ARGS__)
35 
36 #else
37 #define LOG_INFO(M, ...)
38 #endif
39 
40 #define LOG_ERROR(M, ...) \
41  fprintf(stderr, "[ERROR] %s:%d: " M "\n", __FILE__, __LINE__, ##__VA_ARGS__)
42 
43 #define LOG_WARN(M, ...) \
44  fprintf(stderr, "[WARNING] %s:%d: " M "\n", __FILE__, __LINE__, ##__VA_ARGS__)
45 
46 #if ENABLE_DEBUG_MSG
47 #define LOG_DEBUG(M, ...) \
48  fprintf(stderr, "[DEBUG]: " M "\n", ##__VA_ARGS__)
49 #else
50 #define LOG_DEBUG(M, ...)
51 #endif
52 
53 
54 #endif /* UTILS_LOG_H_ */