1 /* GNU Mailutils -- a suite of utilities for electronic mail 2 Copyright (C) 2010-2021 Free Software Foundation, Inc. 3 4 GNU Mailutils is free software; you can redistribute it and/or modify 5 it under the terms of the GNU General Public License as published by 6 the Free Software Foundation; either version 3, or (at your option) 7 any later version. 8 9 GNU Mailutils is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 GNU General Public License for more details. 13 14 You should have received a copy of the GNU General Public License 15 along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>. */ 16 17 #ifndef _MAILUTILS_LOG_H 18 #define _MAILUTILS_LOG_H 19 20 #ifdef __cplusplus 21 extern "C" { 22 #endif 23 24 #include <mailutils/types.h> 25 26 #define MU_LOG_DEBUG 0 27 #define MU_LOG_INFO 1 28 #define MU_LOG_NOTICE 2 29 #define MU_LOG_WARNING 3 30 #define MU_LOG_ERROR 4 31 #define MU_LOG_CRIT 5 32 #define MU_LOG_ALERT 6 33 #define MU_LOG_EMERG 7 34 35 #define MU_LOGMODE_SEVERITY 0x0001 36 #define MU_LOGMODE_LOCUS 0x0002 37 #define MU_LOGMODE_PREFIX 0x0004 38 39 int mu_log_stream_create (mu_stream_t *, mu_stream_t); 40 int mu_syslog_stream_create (mu_stream_t *, int); 41 42 int mu_severity_from_string (const char *str, unsigned *pn); 43 int mu_severity_to_string (unsigned n, const char **pstr); 44 45 extern char *_mu_severity_str[]; 46 extern int _mu_severity_num; 47 48 #ifdef __cplusplus 49 } 50 #endif 51 52 #endif 53 54