#23881: Implement a way to utilise tor's logging system from Rust code
------------------------------+------------------------------------
 Reporter:  isis              |          Owner:  chelseakomlo
     Type:  enhancement       |         Status:  needs_review
 Priority:  High              |      Milestone:  Tor: 0.3.3.x-final
Component:  Core Tor/Tor      |        Version:
 Severity:  Normal            |     Resolution:
 Keywords:  rust, rust-pilot  |  Actual Points:
Parent ID:                    |         Points:  3
 Reviewer:                    |        Sponsor:
------------------------------+------------------------------------

Comment (by chelseakomlo):

 Replying to [comment:16 manish.earth]:
 > > However, I ran into issues due to the limitation of creating non-
 struct static types in stable Rust.
 >
 > The `lazy_static` crate helps here, `static mut` is something you rarely
 use.

 I don't think we should import this crate just for this test case- I did
 see that come up as an option though.


 > > I am unable to run cargo test with a specific flag. For example, I
 wanted to be able to run cargo test --feature "testing",
 >
 >
 > You'll want to make the feature depend on features from other crates.

 Thanks! I didn't see that that was a possibility, that is super helpful, I
 added this in the last commit in this branch. We can now run tests via
 `cargo test --features "testing"` where the code has a dependency to C
 with a no-op (such as in the protover module), and still unit test the
 Rust code. I'm pretty happy about that.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/23881#comment:17>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Reply via email to