GithubHelp home page GithubHelp logo

Comments (9)

emabee avatar emabee commented on May 28, 2024 1

Version 0.12.0 is now published and should work with rocket as expected!

from flexi_logger.

emabee avatar emabee commented on May 28, 2024

Yes, exactly this is possible.
Example:
Logger::with_env_or_str("info, mymod1=debug, mymod2=error, mymod1::mysubmod = off")
will not log any messages from mymod1::mysubmod, although mymod1is set to "debug".

from flexi_logger.

thepixelmonk avatar thepixelmonk commented on May 28, 2024

nice, thanks for the clarification.

from flexi_logger.

thepixelmonk avatar thepixelmonk commented on May 28, 2024

so.. if I try using:

with_str("info, rocket=off")

I still see a bunch of output from rocket in the logfile:

INFO [rocket::rocket] 🔧 Configured for production.
INFO [rocket::rocket] address: ^[[1;49;39m0.0.0.0^[[0m
INFO [rocket::rocket] port: ^[[1;49;39m10000^[[0m
INFO [rocket::rocket] log: ^[[1;49;39moff^[[0m
INFO [rocket::rocket] workers: ^[[1;49;39m16^[[0m
INFO [rocket::rocket] secret key: ^[[1;49;39mprovided^[[0m
INFO [rocket::rocket] limits: ^[[1;49;39mforms = 32KiB^[[0m
INFO [rocket::rocket] keep-alive: ^[[1;49;39m5s^[[0m
INFO [rocket::rocket] tls: ^[[1;49;39mdisabled^[[0m
INFO [rocket::rocket] ^[[33m[extra]^[[0m template_dir: ^[[1;49;39m"templates"^[[0m
INFO [rocket::rocket] ^[[33m[extra]^[[0m databases: ^[[1;49;39m{ redis = { url = "redis://localhost" } }^[[0m

if I use:

with_str("mymodule")

I don't see any output from rocket and only output from mymodule. Any ideas?

from flexi_logger.

emabee avatar emabee commented on May 28, 2024

from flexi_logger.

emabee avatar emabee commented on May 28, 2024

Fixed with 0.11.5 which is available now on crates.io

from flexi_logger.

thepixelmonk avatar thepixelmonk commented on May 28, 2024

I'm now on 0.11.5 and using with_env_or_str("info, rocket=off, serenity=off"), but am still seeing the following in stdout:

ERROR [rocket::rocket] No matching routes for GET /index.php.
WARN [rocket::rocket] Responding with 404 Not Found catcher.

from flexi_logger.

emabee avatar emabee commented on May 28, 2024

Rocket uses the log crate in a pretty unusual way, by specifying the „target“ explicitly.
Unfortunately, the log crate is not very clear about the semantics of „target“.
The log macros fill it with the module path, and the log crate once recommended (iirc) and now states that most loggers use „target“ for filtering.
But log records also come with a „module path“, which contains by default the same info as „target“.
I have to experiment a bit. There are chances to make this cleaner, I think.

The log crate should define the semantics of target more precisely.

from flexi_logger.

emabee avatar emabee commented on May 28, 2024

I really think that rocket overstretches the possibilities of the log crate. I doesn't seem to be a good idea that libraries choose to log to different targets.

Nevertheless, there's a new flexi_logger version on master that should solve the issues with rocket for now. The fix has impact on the API for additional writers (which are addressed via the target info), so it is an alpha version of 0.12.

I will need to merge some other stuff in and polish before I can publish on crates.io.

from flexi_logger.

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.