Class LogWriter

Class Documentation

class LogWriter

LogWriter defines interface for log message output. This class is not expected for directly use, use MS_LOG instead.

Public Functions

LogWriter(LogLevel level, const char *file, int line, const char *func)

Create a LogWriter with the given log level, file name, line number and function name.

Parameters:
  • level[in] The log level.

  • file[in] The file name.

  • line[in] The line number.

  • func[in] The function name.

~LogWriter()

Destructor for LogWriter.

void operator<(const LogStream &stream) const noexcept

Output log message from the input log stream.

Parameters:

stream[in] The input log stream.

void operator^ (const LogStream &stream) const NO_RETURN

Output log message from the input log stream and then throw exception.

Parameters:

stream[in] The input log stream.

Public Static Functions

static bool IsEnabled(LogLevel level)

Check whether the given log level is enabled or not.

Returns:

True if the log level is enabled, false otherwise.