diff options
author | Andrew Bartlett <abartlet@samba.org> | 2009-06-29 20:12:23 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2009-06-29 20:12:23 +1000 |
commit | 6e92505080fd6764461563e4fdf1172be1ba2963 (patch) | |
tree | 89bf7e112f34eee9c9810b4b3d1995628474915b /lib/util | |
parent | 0e95b807b9ff7dee9d53d7294011c6e8cd82fe0e (diff) | |
download | samba-6e92505080fd6764461563e4fdf1172be1ba2963.tar.gz samba-6e92505080fd6764461563e4fdf1172be1ba2963.tar.bz2 samba-6e92505080fd6764461563e4fdf1172be1ba2963.zip |
Fix ndrdump to use a common setup_logging() API
By adding a new common setup_logging_stdout() API, we no longer need to abuse the ABI compatability between the different setup_logging() calls in Samba3 and Samba4's DEBUG() subsystems.
The revert of 49a6d757b4d944cd22c91b2838beb83f04fbe1e9 works with this
to fix bug 6211.
Andrew Bartlett
Diffstat (limited to 'lib/util')
-rw-r--r-- | lib/util/debug.c | 8 | ||||
-rw-r--r-- | lib/util/debug.h | 11 |
2 files changed, 18 insertions, 1 deletions
diff --git a/lib/util/debug.c b/lib/util/debug.c index 76178e2074..996efdff7e 100644 --- a/lib/util/debug.c +++ b/lib/util/debug.c @@ -198,6 +198,14 @@ _PUBLIC_ void setup_logging(const char *prog_name, enum debug_logtype new_logtyp } /** + Just run logging to stdout for this program +*/ +_PUBLIC_ void setup_logging_stdout(void) +{ + setup_logging(NULL, DEBUG_STDOUT); +} + +/** return a string constant containing n tabs no more than 10 tabs are returned */ diff --git a/lib/util/debug.h b/lib/util/debug.h index 7518a64e19..f0d16952a9 100644 --- a/lib/util/debug.h +++ b/lib/util/debug.h @@ -74,7 +74,11 @@ extern int DEBUGLEVEL; */ #define DEBUGTAB(n) do_debug_tab(n) -/** Possible destinations for the debug log */ +/** Possible destinations for the debug log (in order of precedence - + * once set to DEBUG_FILE, it is not possible to reset to DEBUG_STDOUT + * for example. This makes it easy to override for debug to stderr on + * the command line, as the smb.conf cannot reset it back to + * file-based logging */ enum debug_logtype {DEBUG_STDOUT = 0, DEBUG_FILE = 1, DEBUG_STDERR = 2}; /** @@ -102,6 +106,11 @@ _PUBLIC_ void debug_schedule_reopen_logs(void); _PUBLIC_ void setup_logging(const char *prog_name, enum debug_logtype new_logtype); /** + Just run logging to stdout for this program +*/ +_PUBLIC_ void setup_logging_stdout(void); + +/** return a string constant containing n tabs no more than 10 tabs are returned */ |