# StringLogSink

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/logging/struct-stringlogsink/

**struct** · [`ferroui-base`](/docs/0.5.0/api/ferroui-base/) · v0.5.0

```rust
struct StringLogSink
```

A sink that formats events as text lines and hands them to a callback.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/logging/string_log_sink.rs#L9)

## Members

- [`new`](#function-new)
- [`trace`](#function-trace)

<a id="function-new"></a>

### new

```rust
fn new(logger: impl Fn(&str) -> () + Send + Sync + 'static, minimum_level: LogEventLevel, areas: &[&str]) -> Self
```

Creates a sink that passes every formatted event with at least
`minimum_level` to `logger`. When `areas` is not empty only events of
those areas are logged; valid values are listed in
`LogArea`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/logging/string_log_sink.rs#L20)

<a id="function-trace"></a>

### trace

```rust
fn trace(minimum_level: LogEventLevel, areas: &[&str]) -> Self
```

Creates a sink that writes events to the diagnostic trace output of
the process (standard error).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/logging/string_log_sink.rs#L30)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ErasedDestructor`
- `IntoEither`
- [`ILogSink`](/docs/0.5.0/api/ferroui-base/logging/trait-ilogsink/)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
