Comments (3)
@daboross is there a way to get fern to work with tracing in the meantime?
No, not at the moment. I would say to use Dispatch::filter
, but log::Metadata
only exposes the target, not the originating module.
We might be able to get a fix in on tracing's side, if the fact that they overwrite the target
with their own internal one is a bug, rather than a feature. But I haven't tried to contact them about it.
Is this error related to the targets for module level filtering? I think this might be related to this issue: tokio-rs/tracing#1237 in
tracing
This is unrelated - looks like it was solved in discussion with the other issue, though! Agreed with the notgull's comment there - it looks like a conflict for the global logger - there can be only one.
You may be able to get this to work without modifications if you can set up fern
to receive only messages from tracing-subscriber
? I don't know their API too well, but on ferns side at least, it doesn't need to be the global logger.
If you use let (global_level, log) = dispatch.into_log();
instead of .apply()
as the final transformation in fern
, you'll get a boxed logger which you can feed log entries to put through into fern. It won't consume logs globally anymore, but if you can then set up tracing-log
to be registered globally, and forward log entries from that or tracing-subscriber
into the fern logger, then both could co-exist.
from fern.
@daboross is there a way to get fern to work with tracing in the meantime?
from fern.
I get the error Error: SetLoggerError(())
when trying to use fern
with tracing
:
cj@cj-Z:~/projects/macro_sandbox|main ⇒ RUST_BACKTRACE=full cargo run
Compiling macro_sandbox v0.1.0 (/home/cj/projects/macro_sandbox)
Finished dev [unoptimized + debuginfo] target(s) in 1.11s
Running `target/debug/macro_sandbox`
Hello, world!
Error: SetLoggerError(())
cj@cj-Z:~/projects/macro_sandbox|main ⇒
Here is a repo that reproduces the error.
Is this error related to the targets for module level filtering? I think this might be related to this issue: tokio-rs/tracing#1237 in tracing
from fern.
Related Issues (20)
- WithFgColor doesn't match colored::Colorize's behavior
- Doc type: "equivalent form another crate"
- is there anyway to disable all crates log and only show log of my program? HOT 2
- Connection forcibly closed using `TcpStream` as `Box<dyn Write + Send>` HOT 2
- Getting rid of `atty` as a transitive dependency (via `colored`) HOT 25
- `SharedDispatch` type is not accessible HOT 2
- Missing list of dependancies in example HOT 2
- Syslog only logs in UTC HOT 2
- rolling log file when reaches certain size HOT 2
- How to filter by `&Record` HOT 1
- Off the shelf formatters HOT 2
- Open up the architecture HOT 4
- Dispatch::level_for seems broken HOT 7
- Colors and Emojis seem to break rending in Bash and Yakuake HOT 2
- switch from chrono to time HOT 2
- Different formats for differen logging targets? HOT 1
- Possible to chain more files after already intializing a logger?
- Top-level documentation suggests using 0.5 instead of 0.6 HOT 1
- Add new Linux CI HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fern.