[Mlir-commits] [llvm] [mlir] Introduce a "log level" support for DEBUG_TYPE (PR #150855)
Mehdi Amini
llvmlistbot at llvm.org
Mon Jul 28 04:26:26 PDT 2025
================
@@ -119,19 +155,22 @@ getShortFileName(const char *path) {
/// "[DebugType] File:Line "
/// Where the File is the file name without the path prefix.
static LLVM_ATTRIBUTE_UNUSED std::string
-computePrefix(const char *DebugType, const char *File, int Line) {
+computePrefix(const char *DebugType, const char *File, int Line, int Level) {
std::string Prefix;
raw_string_ostream OsPrefix(Prefix);
- if (DebugType)
- OsPrefix << "[" << DebugType << "] ";
+ if (DebugType) {
+ if (Level == 0)
+ Level = 1;
+ OsPrefix << "[" << DebugType << ":" << Level << "] ";
----------------
joker-eph wrote:
I was looking to provide the user with an easy way to filter from a debug output. If you have it here and your output is a bit too verbose you can easily see the level you need to filter on.
https://github.com/llvm/llvm-project/pull/150855
More information about the Mlir-commits
mailing list