lkml.org 
[lkml]   [2022]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v1 23/28] rust: std_vendor: add `dbg!` macro based on `std`'s one
On Thu, Nov 10, 2022 at 08:14:17PM +0100, Miguel Ojeda wrote:
> On Thu, Nov 10, 2022 at 7:02 PM Boqun Feng <boqun.feng@gmail.com> wrote:
> >
> > and I'm almost convinced ;-) Better add the gist of discussion into
> > comment/document/commit log? Users need to know when to use `dbg!` and
> > when to use `pr_debug!`, right?
>
> The docs talk about it a bit:
>
> +/// Note that the macro is intended as a debugging tool and therefore you
> +/// should avoid having uses of it in version control for long periods
> +/// (other than in tests and similar).
>
> That is the original wording from the standard library, but we can
> definitely make the rules more concrete on our end with something

Yeah, having some kernel contexts is better ;-)

> like:
>
> `dbg!` is intended as a temporary debugging tool to be used during
> development. Therefore, avoid committing `dbg!` macro invocations
> into the kernel tree.
>
> For debug output that is intended to be kept, use `pr_debug!` and
> similar facilities instead.
>

Look good to me, thank you!

Regards,
Boqun

> Cheers,
> Miguel

\
 
 \ /
  Last update: 2022-11-10 20:17    [W:0.052 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site