• Main Page
  • Classes
  • Files
  • File List

Swiften/Base/Log.h

00001 /*
00002  * Copyright (c) 2010-2012 Remko Tronçon
00003  * Licensed under the GNU General Public License v3.
00004  * See Documentation/Licenses/GPLv3.txt for more information.
00005  */
00006 
00007 #pragma once
00008 
00009 #include <iostream>
00010 
00011 #include <Swiften/Base/API.h>
00012 
00013 namespace Swift {
00014   extern SWIFTEN_API bool logging;
00015   namespace LogDetail {
00016     // Only here to be able to statically check the correctness of the severity levers
00017     namespace Severity {
00018       enum {
00019         debug, info, warning, error
00020       };
00021     }
00022   }
00023 }
00024 
00025 #define SWIFT_LOG(severity) \
00026   if (!Swift::logging) {} else (void) LogDetail::Severity::severity, std::cerr << "[" << #severity << "] " << __FILE__ << ":" << __LINE__ << " " << __FUNCTION__ << ": "

Generated on Fri Oct 12 2012 21:00:19 for Swiften by  doxygen 1.7.1