dbus-cxx
headerlog.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-3.0-or-later OR BSD-3-Clause
2/***************************************************************************
3 * Copyright (C) 2007,2008,2009 by Rick L. Vinyard, Jr. *
4 * rvinyard@cs.nmsu.edu *
5 * Copyright (C) 2014- by Robert Middleton *
6 * rm5248@rm5248.com *
7 * *
8 * This file is part of the dbus-cxx library. *
9 ***************************************************************************/
10#ifndef DBUSCXX_HEADERLOG_H
11#define DBUSCXX_HEADERLOG_H
12
13#include <sstream>
15
17
18#define DBUSCXX_LOG_CSTR_HEADER( logger, message, level ) do{\
19 if( !dbuscxx_log_function ) break;\
20 struct SL_LogLocation location;\
21 location.line_number = __LINE__;\
22 location.file = __FILE__;\
23 location.function = __func__;\
24 dbuscxx_log_function( logger, &location, level, message );\
25 } while(0)
26
27#define DBUSCXX_DEBUG_STDSTR( logger, message ) do{\
28 std::stringstream stream;\
29 stream << message;\
30 DBUSCXX_LOG_CSTR_HEADER( logger, stream.str().c_str(), SL_DEBUG);\
31 } while(0)
32
33#endif
simplelogger_log_function dbuscxx_log_function
Definition: utility.cpp:25
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