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

Add debug_log macro for one-off debugging #7566

Merged
merged 1 commit into from Apr 16, 2019

Conversation

Projects
None yet
4 participants
@illicitonion
Copy link
Contributor

commented Apr 15, 2019

No description provided.

@illicitonion illicitonion requested a review from blorente Apr 15, 2019

macro_rules! debug_log {
($path:expr, $($arg:tt)+) => {
{
use ::std::io::Write;

This comment has been minimized.

Copy link
@jsirois

jsirois Apr 15, 2019

Member

I actually was doing exactly this just yesterday to prove to myself dup tmpdirs weren't being created for directory materialization without interfering with stdout/stderr which tests relied upon the contents of.

@illicitonion illicitonion merged commit 994751f into pantsbuild:master Apr 16, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@illicitonion illicitonion deleted the twitter:dwagnerhall/debugmacro branch Apr 16, 2019

@blorente
Copy link
Contributor

left a comment

Cool!

/// (info!, debug!, trace!) for that.
///
#[macro_export]
macro_rules! debug_log {

This comment has been minimized.

Copy link
@blorente

blorente Apr 16, 2019

Contributor

If this isn't intended for prod, would it be fair to name it something like _debug_log

This comment has been minimized.

Copy link
@illicitonion

illicitonion Apr 17, 2019

Author Contributor

It probably would... Or a slightly more verbose name like non_production_log or temporary_log or something...

This comment has been minimized.

Copy link
@stuhood

stuhood Apr 17, 2019

Member

My feeling is that the fact this requires a filename as an argument sends a clear enough signal (certainly, it should be relatively easy to review for...?).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.