Microsoft Information Protection (MIP) SDK for C++: Reference 1.15
Doxygen-generated documentation for MIP SDK written in C++
Loading...
Searching...
No Matches
LoggerDelegate Class Referenceabstract

A class that defines the interface to the MIP SDK logger. More...

#include <src/api/mip/logger_delegate.h>

Public Member Functions

virtual void Flush ()=0
 Flush the logger.
 
virtual void Init (const std::string &storagePath)=0
 Initialize the logger.
 
virtual void WriteToLog (const LogLevel level, const std::string &message, const std::string &function, const std::string &file, const int32_t line)=0
 Write a log statement to log file.
 
virtual void WriteToLogWithContext (const LogLevel level, const std::string &message, const std::string &function, const std::string &file, const int32_t line, const std::shared_ptr< void > &)
 Write a log statement to log file with a context.
 
virtual void WriteToLogWithLogMessage (const LogMessageData &logMessage)
 Write a log statement to a log.
 

Detailed Description

A class that defines the interface to the MIP SDK logger.

Definition at line 49 of file logger_delegate.h.

Member Function Documentation

◆ Flush()

virtual void LoggerDelegate::Flush ( )
pure virtual

Flush the logger.

◆ Init()

virtual void LoggerDelegate::Init ( const std::string & storagePath)
pure virtual

Initialize the logger.

Parameters
storagePaththe path to the location where persistent state, including logs, may be stored.

◆ WriteToLog()

virtual void LoggerDelegate::WriteToLog ( const LogLevel level,
const std::string & message,
const std::string & function,
const std::string & file,
const int32_t line )
pure virtual

Write a log statement to log file.

Parameters
levelthe log level for the log statement.
messagethe message for the log statement.
functionthe function name for the log statement.
filethe file name where log statement was generated.
linethe line number where the log statement was generated.

Referenced by WriteToLogWithContext().

◆ WriteToLogWithContext()

virtual void LoggerDelegate::WriteToLogWithContext ( const LogLevel level,
const std::string & message,
const std::string & function,
const std::string & file,
const int32_t line,
const std::shared_ptr< void > &  )
inlinevirtual

Write a log statement to log file with a context.

Override this function to handle the context

Parameters
levelthe log level for the log statement.
messagethe message for the log statement.
functionthe function name for the log statement.
filethe file name where log statement was generated.
linethe line number where the log statement was generated.
contextClient context that was passed into the call that generated this log message

Definition at line 87 of file logger_delegate.h.

93 {
94 WriteToLog(level, message, function, file, line);
95 }
virtual void WriteToLog(const LogLevel level, const std::string &message, const std::string &function, const std::string &file, const int32_t line)=0
Write a log statement to log file.

References WriteToLog().

Referenced by WriteToLogWithLogMessage().

◆ WriteToLogWithLogMessage()

virtual void LoggerDelegate::WriteToLogWithLogMessage ( const LogMessageData & logMessage)
inlinevirtual

Write a log statement to a log.

Parameters
logMessageThe log message data containing the logging information

Definition at line 102 of file logger_delegate.h.

102 {
104 logMessage.GetLevel(),
105 logMessage.GetLogMessage(),
106 logMessage.GetFunction(),
107 logMessage.GetFile(),
108 logMessage.GetLine(),
109 logMessage.GetContext());
110 }
const std::shared_ptr< void > & GetContext() const
The logger context for the log statement.
const std::string & GetLogMessage() const
The message for the log statement.
const std::string & GetFile() const
The file name for the log statement.
const std::string & GetFunction() const
The function name for the log statement.
LogLevel GetLevel() const
The log level for the log statement.
int32_t GetLine() const
The line number for the log statement.
virtual void WriteToLogWithContext(const LogLevel level, const std::string &message, const std::string &function, const std::string &file, const int32_t line, const std::shared_ptr< void > &)
Write a log statement to log file with a context.

References LogMessageData::GetContext(), LogMessageData::GetFile(), LogMessageData::GetFunction(), LogMessageData::GetLevel(), LogMessageData::GetLine(), LogMessageData::GetLogMessage(), and WriteToLogWithContext().


The documentation for this class was generated from the following file: