# ConsoleLogger

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-splat/logging/struct-consolelogger/

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

```rust
struct ConsoleLogger
```

A logger that writes a line per message to the standard output or to a writer
(`ConsoleLogger`), the messages of its level and above.

A message with an exception is written through `exception_message_format`: `{0}` is the
message and `{1}` the exception.



[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Splat/logging/console_logger.rs#L17)

## Members

- [`new`](#function-new)
- [`with_writer`](#function-with_writer)
- [`exception_message_format`](#function-exception_message_format)
- [`set_exception_message_format`](#function-set_exception_message_format)
- [`set_level`](#function-set_level)

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

### new

```rust
fn new() -> Self
```

A logger that writes to the standard output (`ConsoleLogger()`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Splat/logging/console_logger.rs#L31)

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

### with_writer

```rust
fn with_writer(writer: Box<dyn Write>) -> Self
```

A logger that writes to `writer` (`ConsoleLogger(TextWriter)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Splat/logging/console_logger.rs#L36)

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

### exception_message_format

```rust
fn exception_message_format(self: &Self) -> String
```

The format of a message with an exception (`ExceptionMessageFormat`), `{0} - {1}` at
first.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Splat/logging/console_logger.rs#L46)

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

### set_exception_message_format

```rust
fn set_exception_message_format(self: &Self, format: impl Into<String>)
```

Sets the format of a message with an exception.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Splat/logging/console_logger.rs#L51)

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

### set_level

```rust
fn set_level(self: &Self, level: LogLevel)
```

Sets the level (`Level { set; }`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Splat/logging/console_logger.rs#L56)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `Default`
- [`ILogger`](/docs/0.5.0/api/ferroui-headless-vnc/remote_viewing/logging/trait-ilogger/)

## Availability

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