Loading...
Searching...
No Matches
lfs_log.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2024 Joshua DeWeese <josh.deweese@gmail.com>
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser General
5 * Public License v2.1. See the file LICENSE in the top level directory for more
6 * details.
7 */
8
24#ifndef LFS_LOG_H
25#define LFS_LOG_H
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31#include "log.h"
32
40#define _LFS_LOG(level, fmt, ...)\
41 LOG(level, "lfs: " fmt "%s\n", __VA_ARGS__)
42
51#ifndef LFS_NO_DEBUG
52# define LFS_DEBUG(...) _LFS_LOG(LOG_DEBUG, __VA_ARGS__, "")
53#else
54# define LFS_DEBUG(...)
55#endif
56
58#ifndef LFS_NO_WARN
59# define LFS_WARN(...) _LFS_LOG(LOG_WARNING, __VA_ARGS__, "")
60#else
61# define LFS_WARN(...)
62#endif
63
65#ifndef LFS_NO_ERROR
66# define LFS_ERROR(...) _LFS_LOG(LOG_ERROR, __VA_ARGS__, "")
67#else
68# define LFS_ERROR(...)
69#endif
70
73#endif /* LFS_LOG_H */