-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
02407e1
commit c4ac2a7
Showing
18 changed files
with
124 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright (C) 2024 Albin Johansson (GNU General Public License v3.0) | ||
|
||
#pragma once | ||
|
||
#include <format> // make_format_args, format_args | ||
|
||
#include "tactile/base/container/string.hpp" | ||
#include "tactile/base/log/log_level.hpp" | ||
#include "tactile/base/prelude.hpp" | ||
#include "tactile/runtime/api.hpp" | ||
|
||
namespace tactile { | ||
namespace internal { | ||
|
||
TACTILE_RUNTIME_API void log(LogLevel level, StringView fmt, std::format_args args); | ||
|
||
} // namespace internal | ||
|
||
/** | ||
* Logs a message using the internal logger. | ||
* | ||
* \tparam Args The format argument types. | ||
* | ||
* \param level The severity of the message. | ||
* \param fmt The format string. | ||
* \param args The format arguments. | ||
*/ | ||
template <typename... Args> | ||
void log(const LogLevel level, const StringView fmt, const Args&... args) | ||
{ | ||
internal::log(level, fmt, std::make_format_args(args...)); | ||
} | ||
|
||
} // namespace tactile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright (C) 2024 Albin Johansson (GNU General Public License v3.0) | ||
|
||
#include "tactile/runtime/logging.hpp" | ||
|
||
#include "tactile/base/util/buffer.hpp" | ||
#include "tactile/core/log/logger.hpp" | ||
|
||
namespace tactile::internal { | ||
|
||
void log(const LogLevel level, const StringView fmt, const std::format_args args) | ||
{ | ||
Buffer<char, 256> buffer; // NOLINT uninitialized | ||
vformat_to_buffer(buffer, fmt, args); | ||
TACTILE_LOG(level, "{}", buffer.view()); | ||
} | ||
|
||
} // namespace tactile::internal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.