# syslog_runtime::LogBufferBuilder

`#include <log_message_impl.h>`

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

## Summary

| ### Constructors and Destructors ||
|---|---|
| `https://fuchsia.dev/reference/cpp/class/syslog-runtime/log-buffer-builder#classsyslog__runtime_1_1_log_buffer_builder_1a36de16c64a11287cc8afd7424b79a366(fuchsia_logging::LogSeverity severity)` ||

| ### Public functions ||
|---|---|
| `https://fuchsia.dev/reference/cpp/class/syslog-runtime/log-buffer-builder#classsyslog__runtime_1_1_log_buffer_builder_1a4cef671b28444ad2359938f50f3d812e()` | `https://fuchsia.dev/reference/cpp/class/syslog-runtime/log-buffer#classsyslog__runtime_1_1_log_buffer` Builds the [LogBuffer](https://fuchsia.dev/reference/cpp/class/syslog-runtime/log-buffer#classsyslog__runtime_1_1_log_buffer). |
| `https://fuchsia.dev/reference/cpp/class/syslog-runtime/log-buffer-builder#classsyslog__runtime_1_1_log_buffer_builder_1abaa4d1dac2d49e2f8bea2de66f9f2009(https://fuchsia.dev/reference/cpp/class/cpp17/basic-string-view#classcpp17_1_1basic__string__view condition)` | `https://fuchsia.dev/reference/cpp/class/syslog-runtime/log-buffer-builder#classsyslog__runtime_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/syslog-runtime/log-buffer-builder#classsyslog__runtime_1_1_log_buffer_builder_1a983965272bc1fb1b7d1669af7d17db59(https://fuchsia.dev/reference/cpp/class/cpp17/basic-string-view#classcpp17_1_1basic__string__view file, unsigned int line)` | `https://fuchsia.dev/reference/cpp/class/syslog-runtime/log-buffer-builder#classsyslog__runtime_1_1_log_buffer_builder &` Sets the file name and line number for the log message. |
| `https://fuchsia.dev/reference/cpp/class/syslog-runtime/log-buffer-builder#classsyslog__runtime_1_1_log_buffer_builder_1a2507291b71a404afc5dab8f7e6423e1a(https://fuchsia.dev/reference/cpp/class/cpp17/basic-string-view#classcpp17_1_1basic__string__view msg)` | `https://fuchsia.dev/reference/cpp/class/syslog-runtime/log-buffer-builder#classsyslog__runtime_1_1_log_buffer_builder &` Sets the message for the log message. |

## Public functions

### Build

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

### LogBufferBuilder

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

### WithCondition

```c++
LogBufferBuilder & WithCondition(
  cpp17::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(
  cpp17::string_view file,
  unsigned int line
)
```
Sets the file name and line number for the log message.

### WithMsg

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