rnsf

Define and load a phase function data format
git clone git://git.meso-star.fr/rnsf.git
Log | Files | Refs | README | LICENSE

rnsf_log.h (2333B)


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