aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/utility/Logger.hpp
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2023-10-28 11:39:08 +0200
committer hop311 <hop3114@gmail.com>2023-10-29 20:42:47 +0100
commit164264b047921dbe1567d2af183e1cffb200a8cb (patch)
tree21c3c81f65ac3259db4808ebe9fd32a94ca993af /src/openvic-simulation/utility/Logger.hpp
parentd8ec90f07342876e9331819bd3cc372050f78248 (diff)
Astyle formatting (with manual cleanup)
Diffstat (limited to 'src/openvic-simulation/utility/Logger.hpp')
-rw-r--r--src/openvic-simulation/utility/Logger.hpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/openvic-simulation/utility/Logger.hpp b/src/openvic-simulation/utility/Logger.hpp
index d60e59e..b2395ac 100644
--- a/src/openvic-simulation/utility/Logger.hpp
+++ b/src/openvic-simulation/utility/Logger.hpp
@@ -20,15 +20,23 @@ namespace OpenVic {
int _line;
std::string _function;
- public:
source_location(std::string f, int l, std::string n) : _file(f), _line(l), _function(n) {}
- static source_location current(std::string f = __builtin_FILE(), int l = __builtin_LINE(), std::string n = __builtin_FUNCTION()) {
+
+ public:
+ static source_location current(std::string f = __builtin_FILE(), int l = __builtin_LINE(),
+ std::string n = __builtin_FUNCTION()) {
return source_location(f, l, n);
}
- inline char const* file_name() const { return _file.c_str(); }
- inline int line() const { return _line; }
- inline char const* function_name() const { return _function.c_str(); }
+ inline char const* file_name() const {
+ return _file.c_str();
+ }
+ inline int line() const {
+ return _line;
+ }
+ inline char const* function_name() const {
+ return _function.c_str();
+ }
};
#endif
@@ -57,8 +65,10 @@ namespace OpenVic {
log(log_channel_t& log_channel, Ts&&... ts, source_location const& location) {
std::stringstream stream;
stream << "\n" << get_filename(location.file_name()) << "("
- //<< location.line() << ") `" << location.function_name() << "`: ";
- << location.line() << "): ";
+ /* Function name removed to reduce clutter. It is already included
+ * in Godot's print functions, so this was repeating it. */
+ //<< location.line() << ") `" << location.function_name() << "`: ";
+ << location.line() << "): ";
((stream << std::forward<Ts>(ts)), ...);
stream << std::endl;
log_channel.queue.push(stream.str());