From 7a2bc8a3ac055f43c2e3f6970e84c5863dc66a59 Mon Sep 17 00:00:00 2001 From: David Rose Date: Wed, 26 Nov 2008 22:42:44 +0000 Subject: [PATCH] protect spam and debug a little better in opt4 --- dtool/src/prc/notifyCategory.I | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/dtool/src/prc/notifyCategory.I b/dtool/src/prc/notifyCategory.I index d7dff0b1e7..7a47e85926 100644 --- a/dtool/src/prc/notifyCategory.I +++ b/dtool/src/prc/notifyCategory.I @@ -56,7 +56,12 @@ get_severity() const { //////////////////////////////////////////////////////////////////// INLINE void NotifyCategory:: set_severity(NotifySeverity severity) { +#if defined(NOTIFY_DEBUG) _severity = severity; +#else + // enforce the no-debug, no-spam rule. + _severity = max(severity, NS_info); +#endif invalidate_cache(); } @@ -167,7 +172,11 @@ is_fatal() const { //////////////////////////////////////////////////////////////////// INLINE ostream &NotifyCategory:: spam(bool prefix) const { +#if defined(NOTIFY_DEBUG) return out(NS_spam, prefix); +#else + return Notify::null(); +#endif } //////////////////////////////////////////////////////////////////// @@ -177,7 +186,11 @@ spam(bool prefix) const { //////////////////////////////////////////////////////////////////// INLINE ostream &NotifyCategory:: debug(bool prefix) const { +#if defined(NOTIFY_DEBUG) return out(NS_debug, prefix); +#else + return Notify::null(); +#endif } ////////////////////////////////////////////////////////////////////