GithubHelp home page GithubHelp logo

Comments (3)

gyscos avatar gyscos commented on May 23, 2024

Hi,
That's interesting; what kind of debug logs are you seeing?

Grepping for log:: in the repo, I see a couple warn!, but that's about it. It's possible some dependencies do emit logs of their own though; emitting a lot of things at the DEBUG level doesn't sound unreasonable.

The current logger implementation is also very basic, and doesn't offer much filtering. Something like flexi-logger should allow you to specify per-module levels, so you could only allow warnings and errors from cursive (and other dependencies), but see info logs from your own module.

from cursive.

blaisdellma avatar blaisdellma commented on May 23, 2024

Running the above example, I'm seeing logs from

I'm using tracing with tracing-subscriber and it has a feature 'env-filter' which allows you to set per-module logging levels. Without it I get spammed with debug messages from LinearLayout.

It seems like even when at the bottom of a ScrollView scrolling causes a redraw and triggers more debug messages. I think this is because the debug console is added as a layer on the current screen so scrolling the debug console causes the rest of the screen to be redrawn. I guess this didn't get caught cause only some views have debug messages in draw(). Searching for log::debug shows that only 3 views (LinearLayout, TextArea, and ListView) use debug messages at all . The only other parts of cursive that use log::debug are the ncurses and pancurses backends.

Also, the reason that setting RUST_LOG=info is ineffective is because CursiveLogger::enabled() is hardcoded to true, instead of checking the log level. There's even a TODO in CursiveLogger::init() for this.

I think this can be addressed by:

  • changing CursiveLogger to set a log level by checking RUST_LOG or as an argument to cursive::logger::init()
  • changing the debug console to use a new screen instead of just a layer on the current screen to avoid redrawing application and triggering lots of extra debug messages when scrolling

from cursive.

Tandolf avatar Tandolf commented on May 23, 2024

i experienced this today also, in the debug console, logs are flooded with cursive logs. Nice to see that this is being addressed. When might we see a new release with the fixed?

from cursive.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.