From 1a7468a57a11288a007c40d50ed28718d757a546 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 24 Jul 2003 08:53:43 +0000 Subject: * Debug levels. Use `--verbose / -v LEVEL' to display only messages up to the given verbosity levels. These currently are: lvlError = 0, lvlNormal = 5, lvlDebug = 10, lvlDebugMore = 15 although only lvlError and lvlDebug are actually used right now. --- src/util.hh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/util.hh') diff --git a/src/util.hh b/src/util.hh index 8b23bee00b..6d87898b5d 100644 --- a/src/util.hh +++ b/src/util.hh @@ -72,17 +72,26 @@ void deletePath(string path); /* Messages. */ +typedef enum { + lvlError = 0, + lvlNormal = 5, + lvlDebug = 10, + lvlDebugMore = 15 +} Verbosity; + +extern Verbosity verbosity; /* supress msgs > this */ + class Nest { private: bool nest; public: - Nest(bool nest); + Nest(Verbosity level, const format & f); ~Nest(); }; -void msg(const format & f); -void debug(const format & f); +void msg(Verbosity level, const format & f); +void debug(const format & f); /* shorthand */ /* Wrappers arount read()/write() that read/write exactly the -- cgit 1.4.1