htsky

Load and structure a vertically stratified atmosphere
git clone git://git.meso-star.fr/htsky.git
Log | Files | Refs | README | LICENSE

htsky_log.h (2099B)


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