Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support #[no_std] #41

Closed
1 of 2 tasks
dpc opened this issue Sep 9, 2016 · 5 comments
Closed
1 of 2 tasks

Support #[no_std] #41

dpc opened this issue Sep 9, 2016 · 5 comments

Comments

@dpc
Copy link
Collaborator

dpc commented Sep 9, 2016

Job done.

@dpc
Copy link
Collaborator Author

dpc commented Sep 11, 2016

This is awesome.

@dpc dpc modified the milestones: 1.0, Later Sep 13, 2016
@dpc
Copy link
Collaborator Author

dpc commented Oct 2, 2016

I have a basic fmt_streamer crate, but I can't decide whatever the logger (in-memory logger) gathered, should be accessed by the rest of the code. fmt_streamer owns some form of io-like datastructre (eg. circular buffer), and it's not obvious how to access it from outside of the drain-hierarchy.

If that logger would just dump it strait to UART, there's no problem. Otherwise some form of Rc<RefCel<..>> will be required?

@dpc dpc added the discussion label Dec 24, 2016
@tupshin
Copy link

tupshin commented Feb 2, 2017

Is there an example of using the basic no_std support today?

I have

slog = {version = "1.4", default-features = false}
slog-term = "1.4"

in my Cargo.toml, and

#![no_std]

in my lib.rs

My own code is working fine, any the rest of slog seems ok, but the o! macro fails with

failed to resolve. Maybe a missing `extern crate std;`? (in expansion of `o!`) [E0433]: Maybe a missing `extern crate std;`?

I see that there are two versions of that macro, with the alternate being designed for no_std, but not sure what I'm doing wrong.
Thanks

@dpc
Copy link
Collaborator Author

dpc commented Feb 2, 2017

slog-term is the problem, I believe.

So this is how feature flags in cargo work: If you import any crate that imports slog crate that does not disable default flags, std feature will be implicitly reenabled.

slog-term requires libstd, as most slog crates do. slog crate tiself is known to compile and works without std, but the only current drain that would also work without libstd is https://github.com/slog-rs/fmtstream and it's not finished yet.

You can either help me finish fmtstream or write your own Drain (it's very easy).

@dpc
Copy link
Collaborator Author

dpc commented Nov 11, 2017

No help, no progress. Can be finished in the future.

@dpc dpc closed this as completed Nov 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants