gyscos / gyscos/cursive

[BUG] Log flood in the debug console by default.

Open
#714 5 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
4.8k
Forks
270
Avg merge
5d 19h
Merged PRs (30d)
2

Description

**Describe the bug**

Debug console with logs show too many `DEBUG`-level messages by default.

**To Reproduce**

Implement simple app based on README and some functions' documentation. In particular, use `toggle_debug_console` and `logger::init`.

```rust
let mut siv = Cursive::new();
cursive::logger::init();

let linear_layout = LinearLayout::vertical()
.child(TextView::new("Top of the page"))
.child(TextArea::new().fixed_size((20, 5)))
.child(Button::new("Ok", |s| s.quit()));
siv.set_window_title("myapp");
siv.add_fullscreen_layer(linear_layout);

siv.add_global_callback('~', Cursive::toggle_debug_console);
siv.add_global_callback('q', |s| s.quit());

siv.run();
```

**Expected behavior**

Resulting console activated by `~` contains few logs (unless errors happen) from Cursive itself (e.g. just something like "Hello from Cursive version ... running on backend ... on terminal ... on locale ...", "Main window initialized", etc.). New logs from user app are easily visible in it. Interaction with the debug console itself (e.g. scrolling it) does not typically produce new logs. Debug-level logs (especially from Cursive itself) appear only if user explictily configures it from within the code or environment.

**Actual behavior**

The console is flooded by `DEBUG`-level logs originating from Cursive itself, which pile up more and more as I attempt to scroll the console to the bottom. Even starting with `RUST_LOG=info` does not seems to stop this.

**Environment**
* Operating system used: Linux Debian Bookworm amd64
* Backend used: ncurses
* Current locale: C.UTF-8
* Cursive version: 0.20.0

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.