---
title: warn_to
summary: Send a Warn-level message to a specified configured endpoint. Supports C++20 format strings.
url: https://www.fastly.com/documentation/reference/compute/sdks/cpp/fastly/log/fn.warn_to/
---

**Kind:** Function  
**Module:** [log](https://www.fastly.com/documentation/reference/compute/sdks/cpp/fastly/log/)  
**Package:** compute-sdk-cpp 0.7.0  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/log.h#L274

```cpp
template<typename... Args> void fastly::log::warn_to(std::string_view dest, std::format_string<Args...> fmt, Args &&...args)
```

Send a Warn-level message to a specified configured endpoint. Supports C++20 format strings.

Logging must be initialized in order for this to do anything. See [`init_simple()`](https://www.fastly.com/documentation/reference/compute/sdks/cpp/fastly/log/fn.init_simple/) and [`LoggerBuilder`](https://www.fastly.com/documentation/reference/compute/sdks/cpp/fastly/log/class.LoggerBuilder/) for more information.

###### Example

**Parameters**

- `dest`: `std::string_view`
- `fmt`: `std::format_string<Args...>`
- `args`: `Args &&...`

**Returns**

`void`

```cpp
fastly::log::LoggerBuilder()
    .default_endpoint("my_default_logs")
    .endpoint("my_other_endpoint")
    .init();
fastly::log::warn("Whoops");
fastly::log::warn_to("my_other_endpoint", "my name is {}", user->name());
```
