Pcannon Debug 1.0.0-build
Simple yet powerful debug manager for C++
Loading...
Searching...
No Matches
macros.hpp
Go to the documentation of this file.
1#pragma once
2
3// Versioning
4#define PD_VERSION_MAJOR 1
5#define PD_VERSION_MINOR 0
6#define PD_VERSION_PATCH 0
7
8// Version states:
9// dev - Develoment
10// build - Built Version
11#define PD_VERSION_STATE "build"
12
13#define PD_VERSION ((PD_VERSION_MAJOR<<16)|(STT_VERSION_MINOR<<8)|(STT_VERSION_PATCH)|(STT_VERSION_STATE << 24))
14
15#define PD_VERSION_CHECK(PD_VERSION_MAJOR, PD_VERSION_MINOR, PD_VERSION_PATCH, PD_VERSION_STATE) \
16 ((PD_VERSION_MAJOR<<16)|(PD_VERSION_MINOR<<8)|(PD_VERSION_PATCH)|(STT_VERSION_STATE << 24))
17
18/**
19 * @brief Debug log with file and line output capabilities using pd::Debug for debugging
20 * Output it to the standard output
21 * @param _logger Set the logger for pd::Debug capabilities
22 * @param _type Set the type of the log (Ex: Information, Warning, Successs, Error, ...)
23 * @param _msg Set the message to log
24 */
25#define PD_DEBUGLOG(_logger, _type, _msg) \
26 _logger.log(_type, std::string(std::string(__FILE__) + ":" + std::to_string(__LINE__) + " " + _msg), 0)
27
28/**
29 * @brief Simple debug log with file and line output capabilities with fully custom message without any setting needed
30 * Output it to the standard output
31 * @param _type Set the type of the log (Ex: Information, Warning, Successs, Error, ...)
32 * @param _msg Set the message to log
33 */
34#define PD_SIMPLE_DEBUGLOG(_type, _msg) \
35 std::cout << _type << " [" << std::string(std::string(__FILE__) + ":" + std::to_string(__LINE__)) << "] " << _msg << "\n";
36
37// Macro utils
38#define PD_STRINGIFY(x) #x
39#define PD_TOSTRING(x) PD_STRINGIFY(x)
40
41#ifndef PD_DEV
42# define PD_DEV true
43#endif
44