]> git.ipfire.org Git - people/ms/network.git/blame - src/networkd/logging.h
logging: Add WARNING log level
[people/ms/network.git] / src / networkd / logging.h
CommitLineData
c251a9dd
MT
1/*#############################################################################
2# #
3# IPFire.org - A linux based firewall #
4# Copyright (C) 2023 IPFire Network Development Team #
5# #
6# This program is free software: you can redistribute it and/or modify #
7# it under the terms of the GNU General Public License as published by #
8# the Free Software Foundation, either version 3 of the License, or #
9# (at your option) any later version. #
10# #
11# This program is distributed in the hope that it will be useful, #
12# but WITHOUT ANY WARRANTY; without even the implied warranty of #
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14# GNU General Public License for more details. #
15# #
16# You should have received a copy of the GNU General Public License #
17# along with this program. If not, see <http://www.gnu.org/licenses/>. #
18# #
19#############################################################################*/
20
21#ifndef NETWORKD_LOGGING_H
22#define NETWORKD_LOGGING_H
23
1a70a686
MT
24#include <syslog.h>
25
26void nw_log(int priority, const char *file, int line, const char* fn,
27 const char *format, ...) __attribute__((format(printf, 5, 6)));
c251a9dd
MT
28
29/*
30 This is just something simple which will work for now...
31*/
1a70a686 32#define INFO(args...) nw_log(LOG_INFO, __FILE__, __LINE__, __FUNCTION__, ## args)
008488e0 33#define WARNING(args...) nw_log(LOG_WARNING, __FILE__, __LINE__, __FUNCTION__, ## args)
1a70a686
MT
34#define ERROR(args...) nw_log(LOG_ERR, __FILE__, __LINE__, __FUNCTION__, ## args)
35#define DEBUG(args...) nw_log(LOG_DEBUG, __FILE__, __LINE__, __FUNCTION__, ## args)
c251a9dd
MT
36
37#endif /* NETWORKD_LOGGING_H */