diff options
author | Andrew Tridgell <tridge@samba.org> | 2003-11-21 02:50:40 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2003-11-21 02:50:40 +0000 |
commit | 1d7534efd7b555a11ed81311a2163d556cb9e4a0 (patch) | |
tree | 11fcd3d033c8909c8cf1d55671c3a9b846296de7 | |
parent | 236e44c65a110db2f92811f4e94aadc42e3ebd05 (diff) | |
download | samba-1d7534efd7b555a11ed81311a2163d556cb9e4a0.tar.gz samba-1d7534efd7b555a11ed81311a2163d556cb9e4a0.tar.bz2 samba-1d7534efd7b555a11ed81311a2163d556cb9e4a0.zip |
avoid calling the print routines completely if debug level < 2
(This used to be commit 63b9d2803c9e5b44680a72b127f6a58eb44a3c60)
-rw-r--r-- | source4/librpc/ndr/ndr.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/source4/librpc/ndr/ndr.c b/source4/librpc/ndr/ndr.c index bd0d9ce4cb..2f0754d78f 100644 --- a/source4/librpc/ndr/ndr.c +++ b/source4/librpc/ndr/ndr.c @@ -292,10 +292,10 @@ static void ndr_print_debug_helper(struct ndr_print *ndr, const char *format, .. va_end(ap); for (i=0;i<ndr->depth;i++) { - DEBUG(2,(" ")); + DEBUG(0,(" ")); } - DEBUG(2,("%s\n", s)); + DEBUG(0,("%s\n", s)); free(s); } @@ -308,10 +308,6 @@ void ndr_print_debug(void (*fn)(struct ndr_print *, const char *, void *), { struct ndr_print ndr; - if (!DEBUGLVL(2)) { - return; - } - ndr.mem_ctx = talloc_init("ndr_print_debug"); if (!ndr.mem_ctx) return; ndr.print = ndr_print_debug_helper; @@ -320,6 +316,7 @@ void ndr_print_debug(void (*fn)(struct ndr_print *, const char *, void *), talloc_destroy(ndr.mem_ctx); } + /* a useful helper function for printing idl unions via DEBUG() */ @@ -348,6 +345,10 @@ void ndr_print_function_debug(void (*fn)(struct ndr_print *, const char *, int , { struct ndr_print ndr; + if (!DEBUGLVL(2)) { + return; + } + ndr.mem_ctx = talloc_init("ndr_print_function"); if (!ndr.mem_ctx) return; ndr.print = ndr_print_debug_helper; |