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.

参数
  • 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.

参数

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.

参数

stream[in] The input log stream.

Public Static Functions

static bool IsEnabled(LogLevel level)

Check whether the given log level is enabled or not.

返回

True if the log level is enabled, false otherwise.