Develop Biology
The language of life
Macros.h
Go to the documentation of this file.
1/*
2 * This file is a part of the Biology project by eons LLC.
3 * Biology (aka Develop Biology) is a framework for approaching software
4 * development from a natural sciences perspective.
5 *
6 * Copyright (C) 2021 Séon O'Shannon & eons LLC
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU Affero General Public License as
10 * published by the Free Software Foundation, either version 3 of the
11 * License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Affero General Public License for more details.
17 *
18 * You should have received a copy of the GNU Affero General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 */
21
22#pragma once
23
24#define BIO_LOG_PRINTF_MAX_LINE_SIZE 2000 //(+1 for \0)
25
31#define BIO_LOG_LEVEL_FUNCTION_BODY(functionName) \
32BIO_ID_FUNCTION_BODY( \
33 functionName, \
34 ::bio::log::LevelPerspective::Instance(), \
35 ::bio::log::Level)
36
37//@formatter:off
38
39#ifdef BIO_LOG_DISABLE_DEBUG
40 #define BIO_LOG_DEBUG(format, ...)
41#else
42 #define BIO_LOG_DEBUG(format, ...) log(log::Level::Debug(), format, __VA_ARGS__)
43#endif
44#ifdef BIO_LOG_DISABLE_INFO
45 #define BIO_LOG_INFO(format, ...)
46#else
47 #define BIO_LOG_INFO(format, ...) log(log::Level::Info(), format, __VA_ARGS__)
48#endif
49#ifdef BIO_LOG_DISABLE_WARN
50 #define BIO_LOG_WARN(format, ...)
51#else
52 #define BIO_LOG_WARN(format, ...) log(log::Level::Warn(), format, __VA_ARGS__)
53#endif
54#ifdef BIO_LOG_DISABLE_ERROR
55 #define BIO_LOG_ERROR(format, ...)
56#else
57 #define BIO_LOG_ERROR(format, ...) log(log::Level::Error(), format, __VA_ARGS__)
58#endif