Repository navigation
Expand file tree
/
Copy pathdebug.hpp
More file actions
77 lines (66 loc) · 1.47 KB
/
Copy pathdebug.hpp
File metadata and controls
77 lines (66 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/**
* @file debug.hpp
* @brief Unified debug module for Rix.
*/
#ifndef RIXCPP_DEBUG_INCLUDE_RIX_DEBUG_HPP_INCLUDED
#define RIXCPP_DEBUG_INCLUDE_RIX_DEBUG_HPP_INCLUDED
#include <string>
#include <rix/debug/format.hpp>
#include <rix/debug/inspect.hpp>
#include <rix/debug/log.hpp>
#include <rix/debug/print.hpp>
namespace rixlib::debug
{
/**
* @brief Object-style facade for the rix/debug package.
*/
class Debug
{
public:
/**
* @brief Placeholder-based formatting component.
*/
Format format{};
/**
* @brief Logging component.
*/
Log log{};
/**
* @brief Inspection component.
*/
Inspect inspect{};
/**
* @brief Print values separated by spaces, with a trailing newline.
*/
template <typename... Args>
void print(const Args &...args) const
{
rixlib::print(args...);
}
/**
* @brief Print values to stderr.
*/
template <typename... Args>
void eprint(const Args &...args) const
{
rixlib::eprint(args...);
}
/**
* @brief Debug-only print to stderr.
*/
template <typename... Args>
void dprint(const Args &...args) const
{
rixlib::dprint(args...);
}
/**
* @brief Format printed values into a string.
*/
template <typename... Args>
[[nodiscard]] std::string sprint(const Args &...args) const
{
return rixlib::sprint(args...);
}
};
}
#endif // RIXCPP_DEBUG_INCLUDE_RIX_DEBUG_HPP_INCLUDED