libfswatch  1.9.3
libfswatch_log.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 Enrico M. Crisostomo
3  *
4  * This program is free software; you can redistribute it and/or modify it under
5  * the terms of the GNU General Public License as published by the Free Software
6  * Foundation; either version 3, or (at your option) any later version.
7  *
8  * This program is distributed in the hope that it will be useful, but WITHOUT
9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
11  * details.
12  *
13  * You should have received a copy of the GNU General Public License along with
14  * this program. If not, see <http://www.gnu.org/licenses/>.
15  */
26 #ifndef LIBFSW_LOG_H
27 # define LIBFSW_LOG_H
28 
29 #include <stdio.h>
30 
34 void fsw_log(const char * msg);
35 
39 void fsw_flog(FILE * f, const char * msg);
40 
45 void fsw_logf(const char * format, ...);
46 
51 void fsw_flogf(FILE * f, const char * format, ...);
52 
56 void fsw_log_perror(const char * msg);
57 
62 void fsw_logf_perror(const char * format, ...);
63 
68 # define FSW_LOG(msg) fsw_logf("%s: ", __func__); fsw_log(msg)
69 
74 # define FSW_ELOG(msg) fsw_flogf(stderr, "%s: ", __func__); fsw_flog(stderr, msg)
75 
80 # define FSW_LOGF(msg, ...) fsw_logf("%s: ", __func__); fsw_logf(msg, __VA_ARGS__)
81 
86 # define FSW_ELOGF(msg, ...) fsw_flogf(stderr, "%s: ", __func__); fsw_flogf(stderr, msg, __VA_ARGS__)
87 
92 # define FSW_FLOGF(f, msg, ...) fsw_flogf(f, "%s: ", __func__); fsw_flogf(f, msg, __VA_ARGS__)
93 
94 #endif /* LIBFSW_LOG_H */
void fsw_flog(FILE *f, const char *msg)
Definition: libfswatch_log.cpp:29
void fsw_logf(const char *format,...)
Definition: libfswatch_log.cpp:34
void fsw_flogf(FILE *f, const char *format,...)
Definition: libfswatch_log.cpp:46
void fsw_logf_perror(const char *format,...)
Definition: libfswatch_log.cpp:63
void fsw_log(const char *msg)
Definition: libfswatch_log.cpp:24
void fsw_log_perror(const char *msg)
Definition: libfswatch_log.cpp:58