diff options
Diffstat (limited to 'Swiften/Base')
-rw-r--r-- | Swiften/Base/Log.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Swiften/Base/Log.h b/Swiften/Base/Log.h index 5e13a20..955227f 100644 --- a/Swiften/Base/Log.h +++ b/Swiften/Base/Log.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2012 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -10,7 +10,15 @@ namespace Swift { extern bool logging; + namespace LogDetail { + // Only here to be able to statically check the correctness of the severity levers + namespace Severity { + enum { + debug, warning, error + }; + } + } } #define SWIFT_LOG(severity) \ - if (!Swift::logging) {} else std::cerr << "[" << #severity << "] " << __FILE__ << ":" << __LINE__ << " " << __FUNCTION__ << ": " + if (!Swift::logging) {} else (void) LogDetail::Severity::severity, std::cerr << "[" << #severity << "] " << __FILE__ << ":" << __LINE__ << " " << __FUNCTION__ << ": " |