mrumtl

Describe materials that vary spectrally
git clone git://git.meso-star.fr/mrumtl.git
Log | Files | Refs | README | LICENSE

mrumtl_log.h (1932B)


      1 /* Copyright (C) 2020-2023 |Méso|Star> (contact@meso-star.com)
      2  *
      3  * This program is free software: you can redistribute it and/or modify
      4  * it under the terms of the GNU General Public License as published by
      5  * the Free Software Foundation, either version 3 of the License, or
      6  * (at your option) any later version.
      7  *
      8  * This program is distributed in the hope that it will be useful,
      9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     11  * GNU General Public License for more details.
     12  *
     13  * You should have received a copy of the GNU General Public License
     14  * along with this program. If not, see <http://www.gnu.org/licenses/>. */
     15 
     16 #ifndef MRUMTL_LOG_H
     17 #define MRUMTL_LOG_H
     18 
     19 #include <rsys/rsys.h>
     20 
     21 #define MSG_INFO_PREFIX "MruMtl:\x1b[1m\x1b[32minfo\x1b[0m: "
     22 #define MSG_ERROR_PREFIX "MruMtl:\x1b[1m\x1b[31merror\x1b[0m: "
     23 #define MSG_WARNING_PREFIX "MruMtl:\x1b[1m\x1b[33mwarning\x1b[0m: "
     24 
     25 struct mrumtl;
     26 struct logger;
     27 
     28 extern LOCAL_SYM res_T
     29 setup_log_default
     30   (struct mrumtl* mrumtl);
     31 
     32 /* Conditionally log a message on the LOG_OUTPUT stream of the mrumtl logger,
     33  * with respect to its verbose flag */
     34 extern LOCAL_SYM void
     35 log_info
     36   (const struct mrumtl* mrumtl,
     37    const char* msg,
     38    ...)
     39 #ifdef COMPILER_GCC
     40   __attribute((format(printf, 2, 3)))
     41 #endif
     42 ;
     43 
     44 /* Conditionally log a message on the LOG_ERROR stream of the mrumtl logger,
     45  * with respect to its verbose flag */
     46 extern LOCAL_SYM void
     47 log_err
     48   (const struct mrumtl* mrumtl,
     49    const char* msg,
     50    ...)
     51 #ifdef COMPILER_GCC
     52   __attribute((format(printf, 2, 3)))
     53 #endif
     54 ;
     55 
     56 /* Conditionally log a message on the LOG_WARNING stream of the mrumtl logger,
     57  * with respect to its verbose flag */
     58 extern LOCAL_SYM void
     59 log_warn
     60   (const struct mrumtl* mrumtl,
     61    const char* msg,
     62    ...)
     63 #ifdef COMPILER_GCC
     64     __attribute((format(printf, 2, 3)))
     65 #endif
     66 ;
     67 
     68 #endif /* MRUMTL_LOG_H */