dbus-cxx logo
headerlog.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2007,2008,2009 by Rick L. Vinyard, Jr. *
3  * rvinyard@cs.nmsu.edu *
4  * Copyright (C) 2014- by Robert Middleton *
5  * rm5248@rm5248.com *
6  * *
7  * This file is part of the dbus-cxx library. *
8  * *
9  * The dbus-cxx library is free software; you can redistribute it and/or *
10  * modify it under the terms of the GNU General Public License *
11  * version 3 as published by the Free Software Foundation. *
12  * *
13  * The dbus-cxx library is distributed in the hope that it will be *
14  * useful, but WITHOUT ANY WARRANTY; without even the implied warranty *
15  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
16  * General Public License for more details. *
17  * *
18  * You should have received a copy of the GNU General Public License *
19  * along with this software. If not see <http://www.gnu.org/licenses/>. *
20  ***************************************************************************/
21 #ifndef DBUSCXX_HEADERLOG_H
22 #define DBUSCXX_HEADERLOG_H
23 
24 #include <sstream>
26 
28 
29 #define DBUSCXX_LOG_CSTR_HEADER( logger, message, level ) do{\
30  if( !dbuscxx_log_function ) break;\
31  struct SL_LogLocation location;\
32  location.line_number = __LINE__;\
33  location.file = __FILE__;\
34  location.function = __func__;\
35  dbuscxx_log_function( logger, &location, level, message );\
36  } while(0)
37 
38 #define DBUSCXX_DEBUG_STDSTR( logger, message ) do{\
39  std::stringstream stream;\
40  stream << message;\
41  DBUSCXX_LOG_CSTR_HEADER( logger, stream.str().c_str(), SL_DEBUG);\
42  } while(0)
43 
44 #endif
void(* simplelogger_log_function)(const char *logger_name, const struct SL_LogLocation *location, const enum SL_LogLevel level, const char *log_string)
Pointer to a function that does the actual log operation.
Definition: simplelogger_defs.h:38
simplelogger_log_function dbuscxx_log_function
Definition: utility.cpp:28

Generated on Sun Mar 19 2017 14:54:27 for dbus-cxx by doxygen 1.8.8