summaryrefslogtreecommitdiff
path: root/binaryninjaapi.h
diff options
context:
space:
mode:
Diffstat (limited to 'binaryninjaapi.h')
-rw-r--r--binaryninjaapi.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h
index 2fe2ed09..9e7e9eff 100644
--- a/binaryninjaapi.h
+++ b/binaryninjaapi.h
@@ -1057,9 +1057,23 @@ namespace BinaryNinja {
*/
size_t GetSessionId();
+ /*! Indent the logger's indentation level by one
+ */
void Indent();
+
+ /*! Decrease the logger's indentation level by one
+ */
void Dedent();
+
+ /*! Set the logger's indentation level to zero
+ */
void ResetIndent();
+
+ /*! Get the string to prepend to log messages to indent them
+
+ \return Indentation string
+ */
+ std::string GetIndent() const;
};
/*! A class allowing registering and retrieving Loggers
@@ -1120,6 +1134,24 @@ namespace BinaryNinja {
static std::vector<std::string> GetLoggerNames();
};
+ /*! RAII helper that indents/dedents a Logger inside a scope
+ \ingroup logging
+ */
+ class LoggerIndentScope
+ {
+ Ref<Logger> m_logger;
+
+ public:
+ LoggerIndentScope(Ref<Logger> logger): m_logger(logger)
+ {
+ m_logger->Indent();
+ }
+ ~LoggerIndentScope()
+ {
+ m_logger->Dedent();
+ }
+ };
+
/*!
@addtogroup coreapi
@{