# fuchsia_logging::LogBufferBuilder

`#include <log_message_impl.h>`

Constructs a [LogBuffer](https://fuchsia.dev/reference/cpp/class/fuchsia-logging/log-buffer#classfuchsia__logging_1_1_log_buffer).

## Summary

| ### Constructors and Destructors ||
|---|---|
| `https://fuchsia.dev/reference/cpp/class/fuchsia-logging/log-buffer-builder#classfuchsia__logging_1_1_log_buffer_builder_1a4fb0a1c2e1cfea05bbfa68b4fe25f6b0(fuchsia_logging::RawLogSeverity severity)` ||

| ### Public functions ||
|---|---|
| `https://fuchsia.dev/reference/cpp/class/fuchsia-logging/log-buffer-builder#classfuchsia__logging_1_1_log_buffer_builder_1a988d50077832f8f01bd3f41f6c791fc8()` | `https://fuchsia.dev/reference/cpp/class/fuchsia-logging/log-buffer#classfuchsia__logging_1_1_log_buffer` Builds the [LogBuffer](https://fuchsia.dev/reference/cpp/class/fuchsia-logging/log-buffer#classfuchsia__logging_1_1_log_buffer). |
| `https://fuchsia.dev/reference/cpp/class/fuchsia-logging/log-buffer-builder#classfuchsia__logging_1_1_log_buffer_builder_1a1ee8f2f0463d8e669be14f093080754c(std::string_view condition)` | `https://fuchsia.dev/reference/cpp/class/fuchsia-logging/log-buffer-builder#classfuchsia__logging_1_1_log_buffer_builder &` Sets the condition for the log message This is used by test frameworks that want to print an assertion message when a test fails. |
| `https://fuchsia.dev/reference/cpp/class/fuchsia-logging/log-buffer-builder#classfuchsia__logging_1_1_log_buffer_builder_1a7758b78795c56d992d69903857e5c389(std::string_view file, unsigned int line)` | `https://fuchsia.dev/reference/cpp/class/fuchsia-logging/log-buffer-builder#classfuchsia__logging_1_1_log_buffer_builder &` Sets the file name and line number for the log message. |
| `https://fuchsia.dev/reference/cpp/class/fuchsia-logging/log-buffer-builder#classfuchsia__logging_1_1_log_buffer_builder_1a0d550e81e282dd45601ad1ea6b908d6b(std::string_view msg)` | `https://fuchsia.dev/reference/cpp/class/fuchsia-logging/log-buffer-builder#classfuchsia__logging_1_1_log_buffer_builder &` Sets the message for the log message. |

## Public functions

### Build

```c++
fuchsia_logging::LogBuffer Build()
```
Builds the [LogBuffer](https://fuchsia.dev/reference/cpp/class/fuchsia-logging/log-buffer#classfuchsia__logging_1_1_log_buffer).

### LogBufferBuilder

```c++
 LogBufferBuilder(
  fuchsia_logging::RawLogSeverity severity
)
```

### WithCondition

```c++
LogBufferBuilder & WithCondition(
  std::string_view condition
)
```
Sets the condition for the log message This is used by test frameworks that want to print an assertion message when a test fails.

This prepends the string "Check failed: "\<\<\<". " to whatever message the user passes.

### WithFile

```c++
LogBufferBuilder & WithFile(
  std::string_view file,
  unsigned int line
)
```
Sets the file name and line number for the log message.

### WithMsg

```c++
LogBufferBuilder & WithMsg(
  std::string_view msg
)
```
Sets the message for the log message.