1 /***************************************************************************** 2 * Copyright (c) 2019 FrontISTR Commons 3 * This software is released under the MIT License, see LICENSE.txt 4 *****************************************************************************/ 5 6 #ifndef HECMW_LOG_INCLUDED 7 #define HECMW_LOG_INCLUDED 8 9 #include <stdarg.h> 10 11 #define HECMW_LOG_MAX 10 12 13 #define HECMW_LOG_NONE 0 14 15 #define HECMW_LOG_ERROR 1 16 17 #define HECMW_LOG_WARN 2 18 19 #define HECMW_LOG_INFO 4 20 21 #define HECMW_LOG_DEBUG 8 22 23 #define HECMW_LOG_ALL \ 24 (HECMW_LOG_ERROR | HECMW_LOG_WARN | HECMW_LOG_INFO | HECMW_LOG_DEBUG) 25 26 #define HECMW_LOG_PERROR 1 27 28 #define HECMW_LOG_OPTALL (HECMW_LOG_PERROR) 29 30 extern int HECMW_openlog(const char *logfile, int loglv, int options); 31 32 extern int HECMW_closelog(int id); 33 34 extern int HECMW_vlog(int loglv, const char *fmt, va_list ap); 35 36 extern int HECMW_log(int loglv, const char *fmt, ...); 37 38 extern void HECMW_setloglv(int loglv); 39 40 extern void HECMW_log_set_enable(int from, int to, int true_or_false); 41 42 #endif 43