sgs_log.h (1901B)
1 /* Copyright (C) 2021-2023 Centre National de la Recherche Scientifique 2 * Copyright (C) 2021-2023 INSA Lyon 3 * Copyright (C) 2021-2023 Institut Mines Télécom Albi-Carmaux 4 * Copyright (C) 2021-2023 |Méso|Star> (contact@meso-star.com) 5 * Copyright (C) 2021-2023 Institut Pascal 6 * Copyright (C) 2021-2023 PhotonLyX (info@photonlyx.com) 7 * Copyright (C) 2021-2023 Université de Lorraine 8 * Copyright (C) 2021-2023 Université Paul Sabatier 9 * Copyright (C) 2021-2023 Université Toulouse - Jean Jaurès 10 * 11 * This program is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU General Public License as published by 13 * the Free Software Foundation, either version 3 of the License, or 14 * (at your option) any later version. 15 * 16 * This program is distributed in the hope that it will be useful, 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 * GNU General Public License for more details. 20 * 21 * You should have received a copy of the GNU General Public License 22 * along with this program. If not, see <http://www.gnu.org/licenses/>. */ 23 24 #ifndef SGS_LOG_H 25 #define SGS_LOG_H 26 27 #include <rsys/rsys.h> 28 29 #define SGS_LOG_INFO_PREFIX "\x1b[1m\x1b[32m>\x1b[0m " 30 #define SGS_LOG_ERROR_PREFIX "\x1b[31merror:\x1b[0m " 31 #define SGS_LOG_WARNING_PREFIX "\x1b[33mwarning:\x1b[0m " 32 33 /* Forward declaration */ 34 struct sgs; 35 36 extern LOCAL_SYM void 37 sgs_log 38 (struct sgs* sgs, 39 const char* msg, 40 ...) 41 #ifdef COMPILER_GCC 42 __attribute((format(printf, 2, 3))) 43 #endif 44 ; 45 46 extern LOCAL_SYM void 47 sgs_log_err 48 (struct sgs* sgs, 49 const char* msg, 50 ...) 51 #ifdef COMPILER_GCC 52 __attribute((format(printf, 2, 3))) 53 #endif 54 ; 55 56 extern LOCAL_SYM void 57 sgs_log_warn 58 (struct sgs* sgs, 59 const char* msg, 60 ...) 61 #ifdef COMPILER_GCC 62 __attribute((format(printf, 2, 3))) 63 #endif 64 ; 65 66 #endif /* SGS_LOG_H */