[Mlir-commits] [llvm] [mlir] Introduce a "log level" support for DEBUG_TYPE (PR #150855)
Mehdi Amini
llvmlistbot at llvm.org
Mon Jul 28 06:23:28 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:
Added a unit-test showing it.
https://github.com/llvm/llvm-project/pull/150855
More information about the Mlir-commits
mailing list